1 //-----------------------------------------------------------------------------
4 // Category : SDK Core Interfaces
5 // Filename : pluginterfaces/base/istringresult.h
6 // Created by : Steinberg, 01/2005
7 // Description : Strings Interface
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 //-----------------------------------------------------------------------------
19 #include "pluginterfaces/base/funknown.h"
23 //------------------------------------------------------------------------
24 /** Interface to return an ascii string of variable size.
25 In order to manage memory allocation and deallocation properly,
26 this interface is used to transfer a string as result parameter of
27 a method requires a string of unknown size.
28 - [host imp] or [plug imp]
31 class IStringResult
: public FUnknown
34 //------------------------------------------------------------------------
35 virtual void PLUGIN_API
setText (const char8
* text
) = 0;
37 //------------------------------------------------------------------------
38 static const FUID iid
;
41 DECLARE_CLASS_IID (IStringResult
, 0x550798BC, 0x872049DB, 0x84920A15, 0x3B50B7A8)
44 //------------------------------------------------------------------------
45 /** Interface to a string of variable size and encoding.
46 - [host imp] or [plug imp]
49 class IString
: public FUnknown
52 //------------------------------------------------------------------------
53 /** Assign ASCII string */
54 virtual void PLUGIN_API
setText8 (const char8
* text
) = 0;
55 /** Assign unicode string */
56 virtual void PLUGIN_API
setText16 (const char16
* text
) = 0;
58 /** Return ASCII string. If the string is unicode so far, it will be converted.
59 So you need to be careful, because the conversion can result in data loss.
60 It is save though to call getText8 if isWideString() returns false */
61 virtual const char8
* PLUGIN_API
getText8 () = 0;
62 /** Return unicode string. If the string is ASCII so far, it will be converted. */
63 virtual const char16
* PLUGIN_API
getText16 () = 0;
65 /** !Do not use this method! Early implementations take the given pointer as
66 internal string and this will cause problems because 'free' will be used to delete the passed memory.
67 Later implementations will redirect 'take' to setText8 and setText16 */
68 virtual void PLUGIN_API
take (void* s
, bool isWide
) = 0;
70 /** Returns true if the string is in unicode format, returns false if the string is ASCII */
71 virtual bool PLUGIN_API
isWideString () const = 0;
73 //------------------------------------------------------------------------
74 static const FUID iid
;
77 DECLARE_CLASS_IID (IString
, 0xF99DB7A3, 0x0FC14821, 0x800B0CF9, 0x8E348EDF)
79 //------------------------------------------------------------------------
80 } // namespace Steinberg