1 #include "mof/FilePath.hpp"
2 #include <boost/regex.hpp>
3 #include "mof/ConsoleIO.hpp"
6 mof::FilePath::FilePath(const mof::tstring& path){
11 mof::tstring mof::FilePath::getFormat(){
13 boost::regex regex("(.*)\\.(.*)");//name . format
15 //
\8a¿
\8e\9a\82É
\82Í
\91Î
\89\9e\82µ
\82Ä
\82¢
\82È
\82¢
16 if(!boost::regex_search(m_path , match , regex)){
17 DEBUG_PRINT(_T("FormatError --- ") << m_path);
18 return mof::tstring();
22 catch (std::exception &e) {
25 return mof::tstring();
29 mof::tstring& mof::FilePath::getPath(){
33 mof::tstring mof::FilePath::dir(){
35 boost::regex regex("(.*)/[^/]*\\.(.*)");//name . format
37 //
\8a¿
\8e\9a\82É
\82Í
\91Î
\89\9e\82µ
\82Ä
\82¢
\82È
\82¢
38 if(!boost::regex_search(m_path , match , regex)){
39 DEBUG_PRINT(_T("FormatError --- ") << m_path);
40 return mof::tstring();
44 catch (std::exception &e) {
47 return mof::tstring();
51 mof::tstring mof::FilePath::basename(){
53 boost::regex regex("(.*)/([^/]*)");//name . format
55 //
\8a¿
\8e\9a\82É
\82Í
\91Î
\89\9e\82µ
\82Ä
\82¢
\82È
\82¢
56 if(!boost::regex_search(m_path , match , regex)){
57 DEBUG_PRINT(_T("FormatError --- ") << m_path);
58 return mof::tstring();
62 catch (std::exception &e) {
65 return mof::tstring();