00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00017 #ifndef __DERS__PATH_HPP__
00018 #define __DERS__PATH_HPP__
00019 
00020 #include <ders/config.hpp>
00021 #include <vector>
00022 #include <ders/text.hpp>
00023 
00024 namespace ders {  
00025 
00029 struct path_elmt {
00031        enum type {
00032             drive,  
00033             name,   
00034             root,   
00035             share   
00036        };
00037 
00038        type tp;
00039        ch_rng nm;
00040 
00041        path_elmt(type t, const ch_rng& n) : tp(t), nm(n) {}
00042 };
00043 
00047 extern const char pathSepr;
00048 
00055 void parse_path(mem_pool& mp, const ch_rng& path, std::vector<path_elmt>& ret);
00056 
00065 sh_text make_path(mem_pool& mp, const path_elmt* beg, const path_elmt* end, char
00066   spr=pathSepr);
00067 
00074 sh_text normalize_path(mem_pool& mp, const ch_rng& path);
00075 
00082 sh_text get_path(mem_pool& mp, const ch_rng& path);
00083 
00090 sh_text get_name(mem_pool& mp, const ch_rng& path);
00091 
00092 }  
00093 
00094 #endif  // __DERS__PATH_HPP__
00095