コード例 #1
0
void CMapiFolderList::DumpList( void)
{
  CMapiFolder *pFolder;
  nsString  str;
  int      depth;
  char    prefix[256];

  MAPI_TRACE0( "Folder List ---------------------------------\n");
  for (int i = 0; i < m_array.Count(); i++) {
    pFolder = (CMapiFolder *)GetAt( i);
    depth = pFolder->GetDepth();
    pFolder->GetDisplayName( str);
    depth *= 2;
    if (depth > 255)
      depth = 255;
    memset( prefix, ' ', depth);
    prefix[depth] = 0;
#ifdef MAPI_DEBUG
        char *ansiStr = ToNewCString(str);
    MAPI_TRACE2( "%s%s: ", prefix, ansiStr);
    NS_Free(ansiStr);
#endif
    pFolder->GetFilePath( str);
#ifdef MAPI_DEBUG
        ansiStr = ToNewCString(str);
    MAPI_TRACE2( "depth=%d, filePath=%s\n", pFolder->GetDepth(), ansiStr);
    NS_Free(ansiStr);
#endif
  }
  MAPI_TRACE0( "---------------------------------------------\n");
}
コード例 #2
0
void CMapiFolderList::GenerateFilePath( CMapiFolder *pFolder)
{
  // A file path, includes all of my parent's path, plus mine
  nsString    name;
  nsString    path;
  if (!pFolder->GetDepth()) {
    pFolder->GetDisplayName( name);
    pFolder->SetFilePath(name.get());
    return;
  }

  CMapiFolder *  pCurrent;
  int        i = m_array.Count() - 1;
  while (i >= 0) {
    pCurrent = (CMapiFolder *) GetAt( i);
    if (pCurrent->GetDepth() == (pFolder->GetDepth() - 1)) {
      pCurrent->GetFilePath( path);
      path.AppendLiteral(".sbd\\");
      pFolder->GetDisplayName( name);
      path += name;
      pFolder->SetFilePath(path.get());
      return;
    }
    i--;
  }
  pFolder->GetDisplayName( name);
  pFolder->SetFilePath(name.get());
}