Audio plugin host https://kx.studio/carla
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.

81 lines
3.2KB

  1. //-----------------------------------------------------------------------------
  2. // Project : SDK Core
  3. //
  4. // Category : SDK Core Interfaces
  5. // Filename : pluginterfaces/base/istringresult.h
  6. // Created by : Steinberg, 01/2005
  7. // Description : Strings Interface
  8. //
  9. //-----------------------------------------------------------------------------
  10. // This file is part of a Steinberg SDK. It is subject to the license terms
  11. // in the LICENSE file found in the top-level directory of this distribution
  12. // and at www.steinberg.net/sdklicenses.
  13. // No part of the SDK, including this file, may be copied, modified, propagated,
  14. // or distributed except according to the terms contained in the LICENSE file.
  15. //-----------------------------------------------------------------------------
  16. #pragma once
  17. #include "pluginterfaces/base/funknown.h"
  18. namespace Steinberg {
  19. //------------------------------------------------------------------------
  20. /** Interface to return an ascii string of variable size.
  21. In order to manage memory allocation and deallocation properly,
  22. this interface is used to transfer a string as result parameter of
  23. a method requires a string of unknown size.
  24. - [host imp] or [plug imp]
  25. - [released: SX 4]
  26. */
  27. class IStringResult : public FUnknown
  28. {
  29. public:
  30. //------------------------------------------------------------------------
  31. virtual void PLUGIN_API setText (const char8* text) = 0;
  32. //------------------------------------------------------------------------
  33. static const FUID iid;
  34. };
  35. DECLARE_CLASS_IID (IStringResult, 0x550798BC, 0x872049DB, 0x84920A15, 0x3B50B7A8)
  36. //------------------------------------------------------------------------
  37. /** Interface to a string of variable size and encoding.
  38. - [host imp] or [plug imp]
  39. - [released: ]
  40. */
  41. class IString : public FUnknown
  42. {
  43. public:
  44. //------------------------------------------------------------------------
  45. /** Assign ASCII string */
  46. virtual void PLUGIN_API setText8 (const char8* text) = 0;
  47. /** Assign unicode string */
  48. virtual void PLUGIN_API setText16 (const char16* text) = 0;
  49. /** Return ASCII string. If the string is unicode so far, it will be converted.
  50. So you need to be careful, because the conversion can result in data loss.
  51. It is save though to call getText8 if isWideString() returns false */
  52. virtual const char8* PLUGIN_API getText8 () = 0;
  53. /** Return unicode string. If the string is ASCII so far, it will be converted. */
  54. virtual const char16* PLUGIN_API getText16 () = 0;
  55. /** !Do not use this method! Early implementations take the given pointer as
  56. internal string and this will cause problems because 'free' will be used to delete the passed memory.
  57. Later implementations will redirect 'take' to setText8 and setText16 */
  58. virtual void PLUGIN_API take (void* s, bool isWide) = 0;
  59. /** Returns true if the string is in unicode format, returns false if the string is ASCII */
  60. virtual bool PLUGIN_API isWideString () const = 0;
  61. //------------------------------------------------------------------------
  62. static const FUID iid;
  63. };
  64. DECLARE_CLASS_IID (IString, 0xF99DB7A3, 0x0FC14821, 0x800B0CF9, 0x8E348EDF)
  65. //------------------------------------------------------------------------
  66. } // namespace Steinberg