wrapper class for item ID lists More...
#include <shellclasses.h>


Public Types | |
| typedef SShellPtr< ITEMIDLIST > | super |
Public Member Functions | |
| ShellPath () | |
| ShellPath (IShellFolder *folder, LPCWSTR path) | |
| ShellPath (LPCWSTR path) | |
| ShellPath (IShellFolder *folder, LPCSTR path) | |
| ShellPath (LPCSTR path) | |
| ShellPath (const ShellPath &o) | |
| ShellPath (LPITEMIDLIST p) | |
| ShellPath (LPCITEMIDLIST p) | |
| void | operator= (const ShellPath &o) |
| void | operator= (ITEMIDLIST *p) |
| void | operator= (const SHITEMID &o) |
| void | operator+= (const SHITEMID &o) |
| void | assign (LPCITEMIDLIST pidl, size_t size) |
| void | assign (LPCITEMIDLIST pidl) |
| void | split (ShellPath &parent, ShellPath &obj) const |
| void | GetUIObjectOf (REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder()) |
| ShellFolder | get_folder () |
| ShellFolder | get_folder (IShellFolder *parent) |
| ShellPath | create_absolute_pidl (LPCITEMIDLIST parent_pidl) const |
Friends | |
| bool | operator< (const ShellPath &a, const ShellPath &b) |
wrapper class for item ID lists
Definition at line 651 of file shellclasses.h.
| typedef SShellPtr<ITEMIDLIST> ShellPath::super |
Definition at line 653 of file shellclasses.h.
| ShellPath::ShellPath | ( | ) | [inline] |
Definition at line 655 of file shellclasses.h.
{
}
| ShellPath::ShellPath | ( | IShellFolder * | folder, |
| LPCWSTR | path | ||
| ) | [inline] |
Definition at line 659 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_p, CHECKERROR, and CONTEXT.
{
CONTEXT("ShellPath::ShellPath(IShellFolder*, LPCWSTR)");
if (path)
CHECKERROR(folder->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL));
else
_p = NULL;
}
| ShellPath::ShellPath | ( | LPCWSTR | path ) | [inline] |
Definition at line 669 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_p, CHECKERROR, GetDesktopFolder(), and OBJ_CONTEXT.
{
OBJ_CONTEXT("ShellPath::ShellPath(LPCWSTR)", path);
if (path)
CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL));
else
_p = NULL;
}

| ShellPath::ShellPath | ( | IShellFolder * | folder, |
| LPCSTR | path | ||
| ) | [inline] |
Definition at line 679 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_p, CHECKERROR, CONTEXT, and COUNTOF.
| ShellPath::ShellPath | ( | LPCSTR | path ) | [inline] |
Definition at line 692 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_p, CHECKERROR, CONTEXT, COUNTOF, and GetDesktopFolder().
{
CONTEXT("ShellPath::ShellPath(LPCSTR)");
WCHAR b[MAX_PATH];
if (path) {
MultiByteToWideChar(CP_ACP, 0, path, -1, b, COUNTOF(b));
CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, b, NULL, &_p, NULL));
} else
_p = NULL;
}

| ShellPath::ShellPath | ( | const ShellPath & | o ) | [inline] |
Definition at line 705 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, SShellPtr< T >::_p, and ILGetSize.
| ShellPath::ShellPath | ( | LPITEMIDLIST | p ) | [inline, explicit] |
Definition at line 717 of file shellclasses.h.
: super(p) { }
| ShellPath::ShellPath | ( | LPCITEMIDLIST | p ) | [inline] |
Definition at line 722 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, and ILGetSize.
| void ShellPath::assign | ( | LPCITEMIDLIST | pidl, |
| size_t | size | ||
| ) | [inline] |
Definition at line 806 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, and SShellPtr< ITEMIDLIST >::_p.
Referenced by split(), SDIMainFrame::WndProc(), and MDIMainFrame::WndProc().
{
//CONTEXT("ShellPath::assign(LPCITEMIDLIST, size_t)");
ITEMIDLIST* h = _p;
_p = (ITEMIDLIST*) _malloc->Alloc(size+sizeof(USHORT/*SHITEMID::cb*/));
if (_p) {
memcpy(_p, pidl, size);
((ITEMIDLIST*)((LPBYTE)_p+size))->mkid.cb = 0; // terminator
}
_malloc->Free(h);
}

| void ShellPath::assign | ( | LPCITEMIDLIST | pidl ) | [inline] |
Definition at line 822 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, and ILGetSize.
| ShellPath ShellPath::create_absolute_pidl | ( | LPCITEMIDLIST | parent_pidl ) | const |
Definition at line 404 of file shellclasses.cpp.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, CONTEXT, ILGetSize, and TEXT.
Referenced by ShellEntry::create_absolute_pidl(), ShellDirectory::find_entry(), and MainFrameBase::OpenShellFolders().
{
CONTEXT("ShellPath::create_absolute_pidl()");
static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILCombine(TEXT("SHELL32"), 25);
if (ILCombine)
return (*ILCombine)(parent_pidl, _p);
// create a new item id list with _p append behind parent_pidl
int l1 = ILGetSize(parent_pidl) - sizeof(USHORT/*SHITEMID::cb*/);
int l2 = ILGetSize(_p);
LPITEMIDLIST p = (LPITEMIDLIST) _malloc->Alloc(l1+l2);
memcpy(p, parent_pidl, l1);
memcpy((LPBYTE)p+l1, _p, l2);
return p;
}

| ShellFolder ShellPath::get_folder | ( | ) | [inline] |
Definition at line 842 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_p.
{
return ShellFolder(_p);
}
| ShellFolder ShellPath::get_folder | ( | IShellFolder * | parent ) | [inline] |
Definition at line 847 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_p, and CONTEXT.
{
CONTEXT("ShellPath::get_folder()");
return ShellFolder(parent, _p);
}
| void ShellPath::GetUIObjectOf | ( | REFIID | riid, |
| LPVOID * | ppvOut, | ||
| HWND | hWnd = 0, |
||
| ShellFolder & | sf = GetDesktopFolder() |
||
| ) |
Definition at line 362 of file shellclasses.cpp.
References CHECKERROR, CONTEXT, and split().
{
CONTEXT("ShellPath::GetUIObjectOf()");
ShellPath parent, obj;
split(parent, obj);
LPCITEMIDLIST idl = obj;
if (parent && parent->mkid.cb)
// use the IShellFolder of the parent
CHECKERROR(ShellFolder((IShellFolder*)sf,parent)->GetUIObjectOf(hWnd, 1, &idl, riid, 0, ppvOut));
else // else use desktop folder
CHECKERROR(sf->GetUIObjectOf(hWnd, 1, &idl, riid, 0, ppvOut));
}

| void ShellPath::operator+= | ( | const SHITEMID & | o ) | [inline] |
Definition at line 779 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, and ILGetSize.
| void ShellPath::operator= | ( | const ShellPath & | o ) | [inline] |
Definition at line 733 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< T >::_p, SShellPtr< ITEMIDLIST >::_p, and ILGetSize.
| void ShellPath::operator= | ( | const SHITEMID & | o ) | [inline] |
Definition at line 768 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, and SShellPtr< ITEMIDLIST >::_p.
| void ShellPath::operator= | ( | ITEMIDLIST * | p ) | [inline] |
Definition at line 751 of file shellclasses.h.
References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, and ILGetSize.
Definition at line 340 of file shellclasses.cpp.
References assign().
Referenced by GetUIObjectOf().
{
SHITEMID *piid, *piidLast;
int size = 0;
// find last item-id and calculate total size of pidl
for(piid=piidLast=&_p->mkid; piid->cb; ) {
piidLast = piid;
size += (piid->cb);
piid = (SHITEMID*)((LPBYTE)piid + (piid->cb));
}
// copy parent folder portion
size -= piidLast->cb; // don't count "object" item-id
if (size > 0)
parent.assign(_p, size);
// copy "object" portion
obj.assign((ITEMIDLIST*)piidLast, piidLast->cb);
}


|
ROS Explorer Source Code Documentation
generated on 02.01.2013 by
|