Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Execution/Resources/Name.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
5
6namespace Stroika::Foundation::Execution::Resources {
7
8 /*
9 ********************************************************************************
10 ********************************* Resources::Name ******************************
11 ********************************************************************************
12 */
13 inline Name::Name (const String& name, ResourceType type)
14 : fName_ (name.AsSDKString ())
15#if qStroika_Foundation_Common_Platform_Windows
16 , fIntName_ ()
17#endif
18 , fType_ (type)
19 {
20 }
21#if qStroika_Foundation_Common_Platform_Windows
22 inline Name::Name (const int intResName, ResourceType type)
23 : fName_ ()
24 , fIntName_ (intResName)
25 , fType_ (type)
26 {
27 }
28#endif
29 inline String Name::GetPrintName () const
30 {
31#if qStroika_Foundation_Common_Platform_Windows
32 if (fIntName_.has_value ()) {
33 return "#{}"_f(*fIntName_);
34 }
35#endif
36 return String::FromSDKString (fName_);
37 }
38 inline const SDKChar* Name::GetSDKString () const
39 {
40#if qStroika_Foundation_Common_Platform_Windows
41 if (fIntName_.has_value ()) {
42 return MAKEINTRESOURCE (*fIntName_);
43 }
44#endif
45 return fName_.c_str ();
46 }
47 inline ResourceType Name::GetType () const
48 {
49 return fType_;
50 }
51
52}
conditional_t< qTargetPlatformSDKUseswchar_t, wchar_t, char > SDKChar
Definition SDKChar.h:71