home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / UResourceParser / UResourceParser.cp < prev    next >
Encoding:
Text File  |  1996-10-14  |  1.4 KB  |  74 lines  |  [TEXT/CWIE]

  1. // =================================================================================
  2. //    Copyright © 1996 Michael Schürig
  3. //
  4. //    You may copy this file, rip it apart or use it in derivative work as long
  5. //    as you don't change the original file and this message remains intact.
  6. // =================================================================================
  7.  
  8. #include "UResourceParser.h"
  9.  
  10.  
  11. UResourceParser::UResourceParser(
  12.     const Handle inResH)
  13.     throw()
  14. {
  15.     ThrowIfNil_(inResH);
  16.  
  17.     mResH = inResH;
  18.     mOrigResState = ::HGetState(mResH);
  19.     ::HLock(mResH);
  20.     mCursorP = *mResH;
  21.     mEndP = mCursorP + GetHandleSize(mResH);
  22. }
  23.  
  24. UResourceParser::~UResourceParser() throw()
  25. {
  26.     ::HSetState(mResH, mOrigResState);
  27. }
  28.  
  29.  
  30.  
  31. UResourceParser::List::List(UResourceParser *inRP)
  32.     :    mRP(inRP)
  33. {
  34.     Assert_(inRP != nil);
  35. }
  36.  
  37. UResourceParser::List::~List()
  38. {
  39. }
  40.  
  41. UResourceParser::ListUntilZero::ListUntilZero(UResourceParser *inRP)
  42.     :    List(inRP)
  43. {
  44. }
  45.  
  46. UResourceParser::ListZeroBased::ListZeroBased(UResourceParser *inRP)
  47.     :    List(inRP)
  48. {
  49.     mCount = mRP->SWRD();
  50. }
  51.  
  52. UResourceParser::ListZeroBased::~ListZeroBased()
  53. {
  54. }
  55.  
  56. UResourceParser::ListOneBased::ListOneBased(UResourceParser *inRP)
  57.     :    List(inRP)
  58. {
  59.     mCount = mRP->SWRD();
  60. }
  61.  
  62. UResourceParser::ListOneBased::~ListOneBased()
  63. {
  64. }
  65.  
  66. UResourceParser::ListUntilEnd::ListUntilEnd(UResourceParser *inRP)
  67.     :    List(inRP)
  68. {
  69. }
  70.  
  71. UResourceParser::ListUntilEnd::~ListUntilEnd()
  72. {
  73. }
  74.