////////////////////////////////////////////////////////////////////////// AsString -- Returns a TSTRING representation of the current path
| 142 | /////////////////////////////////////////////////////////////////////////////// |
| 143 | // AsString -- Returns a TSTRING representation of the current path |
| 144 | TSTRING cHierDbPath::AsString(void) const |
| 145 | { |
| 146 | TSTRING ret = _T(""); |
| 147 | |
| 148 | if (mCurrPath.size() == 1) |
| 149 | { |
| 150 | ret = *(mCurrPath.begin()); |
| 151 | ret += mDelimitingChar; |
| 152 | return ret; |
| 153 | } |
| 154 | |
| 155 | DbPath::const_iterator it = mCurrPath.begin(); |
| 156 | |
| 157 | // The loop adds delimiting characters until the last element in the |
| 158 | // sequence is reached, so we don't have a trailing character. |
| 159 | while (it != mCurrPath.end()) |
| 160 | { |
| 161 | // the loop is constructed in this odd fashion because I don't want a trailing mDelimiter |
| 162 | ret += (*it); |
| 163 | ++it; |
| 164 | if (it != mCurrPath.end()) |
| 165 | ret += mDelimitingChar; |
| 166 | } |
| 167 | |
| 168 | //return the completed TSTRING |
| 169 | return ret; |
| 170 | } |
| 171 | |
| 172 | /////////////////////////////////////////////////////////////////////////////// |
| 173 | // GetSize: Returns the number of substrings in the sequence |