olestring.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. //
  19. // OLEString
  20. //
  21. #ifndef __OLESTRING_H
  22. #define __OLESTRING_H
  23. const unsigned int OLESTRING_DEFAULT_SIZE = 256;
  24. class OLEString
  25. {
  26. OLECHAR *ole;
  27. char *sb;
  28. unsigned int len;
  29. int locked;
  30. public:
  31. OLEString ( void ) ;
  32. ~OLEString ();
  33. void Set ( OLECHAR *new_ole );
  34. void Set ( char *new_sb );
  35. OLECHAR*Get ( void ) { return ole; };
  36. int Len ( void ) { return len; };
  37. char* GetSB ( void ) { return sb; };
  38. void StripSpaces ( void );
  39. void FormatMetaString ( void );
  40. void Lock ( void ) { locked = TRUE; };
  41. void Unlock ( void ) { locked = FALSE; };
  42. };
  43. template <typename text> void StripSpaces ( text *string );
  44. template <typename text> void ConvertMetaChars ( text *string );
  45. template <typename text> void StripSpacesFromMetaString ( text *string );
  46. template <typename text> int SameFormat ( text *string1, text *string2 );
  47. template <typename text> void EncodeFormat ( text *string );
  48. template <typename text> void DecodeFormat ( text *string );
  49. template <typename text> int IsFormatTypeChar( text string1 );
  50. #endif // __OLESTRING_H