resitem.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. #ifndef RESITEM_H
  19. #define RESITEM_H
  20. //////////////////////////////////////////////////////////////////////////////
  21. // Headers.
  22. //////////////////////////////////////////////////////////////////////////////
  23. //////////////////////////////////////////////////////////////////////////////
  24. // Macros.
  25. //////////////////////////////////////////////////////////////////////////////
  26. //////////////////////////////////////////////////////////////////////////////
  27. // Typedefs.
  28. //////////////////////////////////////////////////////////////////////////////
  29. // Forward define class.
  30. class CRes;
  31. class CResItem
  32. {
  33. public: // Construction/Destruction.
  34. // Default constructor.
  35. CResItem();
  36. // Constructura Especial! Ole!
  37. CResItem(char* pszName, UCHAR* puc, long lSize, CRes* pRes);
  38. // Destructor.
  39. ~CResItem();
  40. public: // Methods.
  41. // Lock this item b4 using.
  42. // Returns new reference count.
  43. short Lock(void);
  44. // Unlock this item when done. Deletes object if m_sRefCnt hits 0.
  45. // Returns new reference count.
  46. short Unlock(void);
  47. public: // Members.
  48. char* m_pszName; // Resource name.
  49. UCHAR* m_puc; // Resource data.
  50. long m_lSize; // Resource size.
  51. short m_sRefCnt; // Number of items using this resource.
  52. CRes* m_pRes; // Res Manager that owns this resource.
  53. };
  54. typedef CResItem* PRESITEM;
  55. #endif // RESITEM_H
  56. //////////////////////////////////////////////////////////////////////////////
  57. // EOF
  58. //////////////////////////////////////////////////////////////////////////////