Logo Search packages:      
Sourcecode: xchm version File versions

bool CHMFile::GetIndex ( CHMListCtrl toBuild  ) 

Attempts to fill a CHMListCtrl by parsing the index file.

Parameters:
toBuild Pointer to the list control to be filled. If the index file is not available, the list control is unmodified. The lost must be empty before passing it to this function.
Returns:
true if it's possible to build the tree, false otherwise.

Definition at line 173 of file chmfile.cpp.

References GetFileAsString(), ResolveObject(), and CHMListCtrl::UpdateUI().

Referenced by CHMFrame::UpdateCHMInfo().

{
      chmUnitInfo ui;

      if(!toBuild)
            return false;

      if(_indexFile.IsEmpty() || !ResolveObject(_indexFile, &ui))
            return false;

      wxString src;
      src.Alloc(ui.length);
      GetFileAsString(src, &ui);

      if(src.IsEmpty())
            return false;

      ContentParser parser;
      parser.AddTagHandler(new ContentTagHandler(_enc,
#ifdef wxUSE_UNICODE
                                       !_font.IsEmpty(),
#else
                                       false,
#endif                                    
                                       NULL, toBuild));
      parser.Parse(src);
      toBuild->UpdateUI();

      return true;
}


Generated by  Doxygen 1.6.0   Back to index