indexfile.cc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: indexfile.cc,v 1.2.2.1 2003/12/24 23:09:17 mdz Exp $
  4. /* ######################################################################
  5. Index File - Abstraction for an index of archive/souce file.
  6. ##################################################################### */
  7. /*}}}*/
  8. // Include Files /*{{{*/
  9. #ifdef __GNUG__
  10. #pragma implementation "apt-pkg/indexfile.h"
  11. #endif
  12. #include <apt-pkg/indexfile.h>
  13. #include <apt-pkg/error.h>
  14. /*}}}*/
  15. // Global list of Item supported
  16. static pkgIndexFile::Type *ItmList[10];
  17. pkgIndexFile::Type **pkgIndexFile::Type::GlobalList = ItmList;
  18. unsigned long pkgIndexFile::Type::GlobalListLen = 0;
  19. // Type::Type - Constructor /*{{{*/
  20. // ---------------------------------------------------------------------
  21. /* */
  22. pkgIndexFile::Type::Type()
  23. {
  24. ItmList[GlobalListLen] = this;
  25. GlobalListLen++;
  26. }
  27. /*}}}*/
  28. // Type::GetType - Locate the type by name /*{{{*/
  29. // ---------------------------------------------------------------------
  30. /* */
  31. pkgIndexFile::Type *pkgIndexFile::Type::GetType(const char *Type)
  32. {
  33. for (unsigned I = 0; I != GlobalListLen; I++)
  34. if (strcmp(GlobalList[I]->Label,Type) == 0)
  35. return GlobalList[I];
  36. return 0;
  37. }
  38. /*}}}*/
  39. // IndexFile::ArchiveInfo - Stub /*{{{*/
  40. // ---------------------------------------------------------------------
  41. /* */
  42. string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator Ver) const
  43. {
  44. return string();
  45. }
  46. /*}}}*/
  47. // IndexFile::FindInCache - Stub /*{{{*/
  48. // ---------------------------------------------------------------------
  49. /* */
  50. pkgCache::PkgFileIterator pkgIndexFile::FindInCache(pkgCache &Cache) const
  51. {
  52. return pkgCache::PkgFileIterator(Cache);
  53. }
  54. /*}}}*/
  55. // IndexFile::SourceIndex - Stub /*{{{*/
  56. // ---------------------------------------------------------------------
  57. /* */
  58. string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &Record,
  59. pkgSrcRecords::File const &File) const
  60. {
  61. return string();
  62. }
  63. /*}}}*/