![]() |
Utility::Path Class Reference#include <Utility.h>
Detailed DescriptionDefinition at line 110 of file Utility.h. Constructor & Destructor Documentation
Definition at line 1234 of file Utility.cpp. References m_ext, m_file, and m_path. 01235 { 01236 std::string str = _str; 01237 for (size_t i = 0; i < str.size(); ++i) 01238 { 01239 #ifdef _WIN32 01240 if (str[i] == '/') 01241 str[i] = '\\'; 01242 #else 01243 if (str[i] == '\\') 01244 str[i] = '/'; 01245 #endif 01246 } 01247 #ifndef _WIN32 01248 struct stat st; 01249 stat(str.c_str(), &st); 01250 if (S_ISDIR(st.st_mode)) 01251 { 01252 m_path = str; 01253 return; 01254 } 01255 #endif 01256 size_t x = 0; 01257 for (size_t i = 0; i < str.size(); ++i) 01258 if (str[i] == '/' || str[i] == '\\') 01259 x = i + 1; 01260 m_path = str.substr(0, x); 01261 m_file = str.substr(x); 01262 for (size_t i = 0; i < m_file.size(); ++i) 01263 if (m_file[i] == '.') 01264 m_ext = m_file.substr(i + 1); 01265 }
Member Function Documentation
Definition at line 115 of file Utility.h. Referenced by Utility::ChangeDirectory(). 00115 { return m_path; }
Member Data Documentation
The documentation for this class was generated from the following files: |