| 14 | } |
| 15 | |
| 16 | HTREEITEM TreeHelper::FindItem(HTREEITEM hParent, PCWSTR path) { |
| 17 | int start = 0; |
| 18 | CString spath(path); |
| 19 | if (spath[0] == L'\\') { |
| 20 | // skip first |
| 21 | spath = spath.Mid(spath.Find(L'\\', 1)); |
| 22 | } |
| 23 | |
| 24 | HTREEITEM hItem = nullptr; |
| 25 | while (hParent) { |
| 26 | auto name = spath.Tokenize(L"\\", start); |
| 27 | if (name.IsEmpty()) |
| 28 | break; |
| 29 | _tv.Expand(hParent, TVE_EXPAND); |
| 30 | hItem = FindChild(hParent, name); |
| 31 | if (!hItem) |
| 32 | break; |
| 33 | hParent = hItem; |
| 34 | } |
| 35 | return hItem; |
| 36 | } |
| 37 | |
| 38 | int TreeHelper::DeleteChildren(HTREEITEM hItem) { |
| 39 | int count = 0; |
no test coverage detected