Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.2 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: locid.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This is the definition of a localization ID. It makes up part of the
  8. // localization unique ID, and is eesentially the implementation for
  9. // CLocResId and CLocTypeId.
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef LOCID_H
  13. #define LOCID_H
  14. #pragma warning(disable : 4275)
  15. class LTAPIENTRY CLocId : public CObject
  16. {
  17. public:
  18. NOTHROW CLocId();
  19. void AssertValid(void) const;
  20. BOOL NOTHROW HasNumericId(void) const;
  21. BOOL NOTHROW HasStringId(void) const;
  22. BOOL NOTHROW IsNull(void) const;
  23. BOOL NOTHROW GetId(ULONG &) const;
  24. BOOL NOTHROW GetId(CPascalString &) const;
  25. void NOTHROW GetDisplayableId(CPascalString &) const;
  26. //
  27. // These 'set' functions are 'write once'. Once the ID has been
  28. // set, it can't be changed. Trying to set the ID again will
  29. // cause an AfxNotSupportedException to be thrown.
  30. //
  31. void SetId(ULONG);
  32. void SetId(const CPascalString &);
  33. void SetId(const WCHAR *);
  34. void SetId(ULONG, const CPascalString &);
  35. void SetId(ULONG, const WCHAR *);
  36. const CLocId &operator=(const CLocId &);
  37. void NOTHROW ClearId(void);
  38. int NOTHROW operator==(const CLocId &) const;
  39. int NOTHROW operator!=(const CLocId &) const;
  40. virtual void Serialize(CArchive &ar);
  41. virtual ~CLocId();
  42. protected:
  43. //
  44. // Internal implementation functions.
  45. //
  46. BOOL NOTHROW IsIdenticalTo(const CLocId&) const;
  47. void NOTHROW CheckPreviousAssignment(void) const;
  48. private:
  49. //
  50. // This prevent the default copy constructor from being
  51. // called.
  52. //
  53. CLocId(const CLocId&);
  54. ULONG m_ulNumericId; // The numeric ID of the resource
  55. CPascalString m_pstrStringId; // The string ID of the resource
  56. BOOL m_fHasNumericId :1; // Indicates if the numeric ID is valid
  57. BOOL m_fHasStringId :1; // Indicates if the string ID is valid
  58. DEBUGONLY(static CCounter m_UsageCounter);
  59. DEBUGONLY(static CCounter m_DisplayCounter);
  60. };
  61. #pragma warning(default : 4275)
  62. #if !defined(_DEBUG) || defined(IMPLEMENT)
  63. #include "locid.inl"
  64. #endif
  65. #endif // LOCID_H