ASPiK SDK
cresourcedescription.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __cresourcedescription__
6 #define __cresourcedescription__
7 
8 #include "vstguibase.h"
9 
10 namespace VSTGUI {
11 
12 //-----------------------------------------------------------------------------
13 // CResourceDescription Declaration
15 //-----------------------------------------------------------------------------
17 {
18 public:
19  enum { kIntegerType, kStringType, kUnknownType };
20 
21  CResourceDescription () = default;
22  CResourceDescription (UTF8StringPtr name) : type (kStringType) { u.name = name; }
23  explicit CResourceDescription (int32_t id) : type (kIntegerType) { u.id = id; }
24 
25  CResourceDescription& operator= (int32_t id) { u.id = id; type = kIntegerType; return *this; }
26  CResourceDescription& operator= (const CResourceDescription& desc) { type = desc.type; u.id = desc.u.id; u.name = desc.u.name; return *this; }
27 
28  int32_t type {kUnknownType};
29  union {
30  int32_t id;
31  UTF8StringPtr name {nullptr};
32  } u;
33 };
34 
35 }
36 
37 #endif // __cresourcedescription__
Describes a resource by name or by ID.
Definition: cresourcedescription.h:16
Definition: customcontrols.cpp:8