home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WRESID.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  3KB  |  106 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WResourceID --
  14.  *
  15.  *************************************************************************/
  16.  
  17. #ifndef _WRESID_HPP_INCLUDED
  18. #define _WRESID_HPP_INCLUDED
  19.  
  20. #ifndef _WNO_PRAGMA_PUSH
  21. #pragma pack(push,8);
  22. #pragma enum int;
  23. #endif
  24.  
  25. #ifndef _WOBJECT_HPP_INCLUDED
  26. #  include "wobject.hpp"
  27. #endif
  28. #ifndef _WARRAY_HPP_INCLUDED
  29. #  include "warray.hpp"
  30. #endif
  31.  
  32. class WCMCLASS WResourceID : public WObject {
  33.     WDeclareSubclass( WResourceID, WObject );
  34.  
  35.     public:
  36.  
  37.         /*********************************************************
  38.          * Constructors and destructors
  39.          *********************************************************/
  40.  
  41.         WResourceID( WInt id=0 );
  42.         WResourceID( const WChar *nm );
  43.         WResourceID( const WResourceID & id );
  44.  
  45.         ~WResourceID();
  46.  
  47.         /*********************************************************
  48.          * Properties
  49.          *********************************************************/
  50.  
  51.         // ID
  52.  
  53.         const WChar * GetID() const;
  54.  
  55.         // IDAsInt
  56.  
  57.         WInt GetIDAsInt() const;
  58.  
  59.         /*********************************************************
  60.          * Methods
  61.          *********************************************************/
  62.  
  63.         // Clear
  64.  
  65.         void Clear();
  66.  
  67.         // Create
  68.  
  69.         WBool Create( WInt number );
  70.         WBool Create( const WChar *name );
  71.         WBool Create( const WResourceID & id );
  72.  
  73.         /*********************************************************
  74.          * Operators
  75.          *********************************************************/
  76.  
  77.         WResourceID & operator=( const WResourceID & resId )
  78.             { Create( resId ); return *this; }
  79.  
  80.         WResourceID & operator=( const WInt id )
  81.             { Create( id ); return *this; }
  82.  
  83.         WResourceID & operator=( const WChar * name )
  84.             { Create( name ); return *this; }
  85.  
  86.         operator WInt() const { return GetIDAsInt(); }
  87.  
  88.         /*********************************************************
  89.          * Data members
  90.          *********************************************************/
  91.  
  92.     private:
  93.         WChar *_resID;
  94. };
  95.  
  96. extern template WArrayReference<WResourceID>;
  97. extern template WArray<WResourceID>;
  98. typedef WArray<WResourceID>             WResourceIDArray;
  99.  
  100. #ifndef _WNO_PRAGMA_PUSH
  101. #pragma enum pop;
  102. #pragma pack(pop);
  103. #endif
  104.  
  105. #endif // _WRESID_HPP_INCLUDED
  106.