home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dosdisas.zip / dccsrcoo.zip / Loader.cpp < prev    next >
C/C++ Source or Header  |  1997-10-10  |  1KB  |  68 lines

  1. /* This file implements the abstract Loader class.
  2.     All classes derived from this class must implement the Load()
  3.     function.
  4.  
  5.     MVE 30/9/97
  6. */
  7.  
  8. #include "Loader.h"
  9.  
  10. Loader::Loader()
  11. {
  12.     m_iNumSections = 0;            // No sections yet
  13.     m_pSections = 0;            // No section data yet
  14.     m_iNumSymbols = 0;            // No symbols
  15.     m_pSymbols = 0;                // No symbol table
  16. }
  17.  
  18. int Loader::GetNumSections() const
  19. {
  20.     return m_iNumSections;
  21. }
  22.  
  23. PSECTIONINFO Loader::GetSectionInfo() const
  24. {
  25.     return m_pSections;
  26. }
  27.  
  28. int Loader::GetNumSyms() const
  29. {
  30.     return m_iNumSymbols;
  31. }
  32.  
  33. PLD_SYMTAB Loader::GetSymTable() const
  34. {
  35.     return m_pSymbols;
  36. }
  37.  
  38. int    Loader::GetSectionIndexByName(const char* sName)
  39. {
  40.     for (int i=0; i < m_iNumSections; i++)
  41.     {
  42.         if (strcmp(m_pSections[i].pSectionName, sName) == 0)
  43.         {
  44.             return i;
  45.         }
  46.     }
  47.     return -1;
  48. }
  49.  
  50. PSECTIONINFO Loader::GetSectionInfoByName(const char* sName)
  51. {
  52.     int i = GetSectionIndexByName(sName);
  53.     if (i == -1) return 0;
  54.     return &m_pSections[i];
  55. }
  56.  
  57. unsigned Loader::GetInitPC() const
  58. {
  59.     return m_uInitPC;
  60. }
  61.  
  62. unsigned Loader::GetInitSP() const
  63. {
  64.     return m_uInitSP;
  65. }
  66.  
  67.  
  68.