acuiString.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef _acuiString_h
  11. #define _acuiString_h
  12. #pragma pack (push, 8)
  13. #if _MSC_VER >= 1000 || defined(__GNUC__)
  14. #pragma once
  15. #endif // _MSC_VER >= 1000
  16. #include "adui_port.h"
  17. #include "AdAChar.h"
  18. //////////////////////////////////////////////////////////////////////////////
  19. // Note: This class is now obsolete and is slated for removal.
  20. class CAcUiString : public CString
  21. {
  22. public:
  23. ACCORE_PORT CAcUiString ();
  24. ACCORE_PORT CAcUiString (const CString& stringSrc);
  25. ACCORE_PORT CAcUiString (ACHAR ch, int nRepeat = 1);
  26. ACCORE_PORT CAcUiString (LPCTSTR psz);
  27. ACCORE_PORT CAcUiString (LPCTSTR pch, int nLength);
  28. ACCORE_PORT CAcUiString (UINT nStringResourceID);
  29. // Character Query Member Functions
  30. public:
  31. ACCORE_PORT BOOL IsTab (int nIndex) const;
  32. ACCORE_PORT BOOL IsWhiteSpace (int nIndex) const;
  33. ACCORE_PORT BOOL IsAlphabetic (int nIndex) const;
  34. ACCORE_PORT BOOL IsAlphanumeric (int nIndex) const;
  35. ACCORE_PORT BOOL IsBlank (int nIndex) const;
  36. ACCORE_PORT BOOL IsPunctuation (int nIndex) const;
  37. ACCORE_PORT BOOL IsUppercase (int nIndex) const;
  38. ACCORE_PORT BOOL IsLowercase (int nIndex) const;
  39. ACCORE_PORT BOOL IsNumeric (int nIndex) const;
  40. ACCORE_PORT BOOL IsHexNumeric (int nIndex) const;
  41. // Misc Functions
  42. public:
  43. ACCORE_PORT void MakeCharUpper (int nIndex);
  44. ACCORE_PORT void MakeCharLower (int nIndex);
  45. ACCORE_PORT void GetCurrentWorkingDirectory ();
  46. ACCORE_PORT void ReplaceCharWithChar (ACHAR chFrom, ACHAR chTo);
  47. // Strip the mnemonic character '&'.
  48. ACCORE_PORT void StripMnemonic ();
  49. // Strip the diesel prefix "$M="
  50. ACCORE_PORT void StripDiesel ();
  51. // Convert Menu execution string to AutoCAD input throat form
  52. ACCORE_PORT void ConvertMenuExecString ();
  53. // Go the other way for display in dialogs and such
  54. ACCORE_PORT void ConvertFromMenuExecString ();
  55. ACCORE_PORT void FixFileName ();
  56. ACCORE_PORT void WrapLine (CAcUiString& strRest, int nWrapAt);
  57. ACCORE_PORT void WrapLine (CStringList& strListWrapped, int nWrapAt);
  58. // Tab Expansion
  59. ACCORE_PORT void ExpandTabs (int nTabSize = 8);
  60. // Stripping Functions
  61. public:
  62. ACCORE_PORT void StripTrailingBlanks ();
  63. ACCORE_PORT void StripPrecedingBlanks ();
  64. ACCORE_PORT void StripTrailingCharacters (ACHAR cChar);
  65. ACCORE_PORT void StripPrecedingCharacters (ACHAR cChar);
  66. // Name shortening functions for symbol table names.
  67. // Useful for Layer and Linetype controls.
  68. public:
  69. ACCORE_PORT void ShortenString (
  70. CDC *pDC,
  71. CString OriginalString,
  72. UINT width
  73. );
  74. ACCORE_PORT CString CreateEllipsedString (
  75. CDC *pDC,
  76. CString OriginalString,
  77. UINT width
  78. );
  79. };
  80. // string class that allows for macro expansion
  81. // use this class instead of CAcUiString when you need to expand a macro
  82. // such as %AUTOCAD% or %PRODUCT% in your string
  83. class CAcUiStringExp : public CAcUiString
  84. {
  85. public:
  86. ACCORE_PORT CAcUiStringExp ();
  87. ACCORE_PORT virtual ~CAcUiStringExp();
  88. ACCORE_PORT CAcUiStringExp (const CString& stringSrc);
  89. ACCORE_PORT CAcUiStringExp (ACHAR ch, int nRepeat = 1);
  90. ACCORE_PORT CAcUiStringExp (LPCTSTR psz);
  91. ACCORE_PORT CAcUiStringExp (LPCTSTR pch, int nLength);
  92. ACCORE_PORT CAcUiStringExp (UINT nStringResourceID);
  93. public:
  94. ACCORE_PORT virtual BOOL LoadString(UINT nID);
  95. // Function to handle replacing product-specific string macros
  96. // with the appropriate text
  97. ACCORE_PORT void ReplaceProductMacroStrings();
  98. };
  99. /////////////////////////////////////////////////////////////////////////////
  100. //{{AFX_INSERT_LOCATION}}
  101. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  102. #pragma pack (pop)
  103. #endif
  104. //////////////////////////////////////////////////////////////////////////////