/////////////////////////////////////////////////////////////////////////// Function name : IsRoot Description : A root path is all '/'s Return type : bool Argument : const TSTRING& strPath //////////////////////////////////////////////////////////////////////////
| 905 | // Argument : const TSTRING& strPath |
| 906 | /////////////////////////////////////////////////////////////////////////////// |
| 907 | bool cUnixFSServices::IsRoot(const TSTRING& strPath) const |
| 908 | { |
| 909 | // and empty path is NOT the root path |
| 910 | if (strPath.empty()) |
| 911 | return false; |
| 912 | |
| 913 | // check to see if all characters are a slash |
| 914 | for (TSTRING::const_iterator iter = strPath.begin(); iter != strPath.end(); iter++) |
| 915 | { |
| 916 | // if we've found a char that's not '/', then it's not the root path |
| 917 | if (*iter != TW_SLASH) |
| 918 | return false; |
| 919 | } |
| 920 | |
| 921 | return true; |
| 922 | } |
| 923 | |
| 924 | //************************************************************************* |
| 925 | //************************************************************************* |
no test coverage detected