1 | // Licensed to the .NET Foundation under one or more agreements. |
---|---|
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | // ============================================================ |
5 | // |
6 | // AssemblyName.inl |
7 | // |
8 | |
9 | |
10 | // |
11 | // Implements the inlined methods of AssemblyName class |
12 | // |
13 | // ============================================================ |
14 | |
15 | #ifndef __BINDER__ASSEMBLY_NAME_INL__ |
16 | #define __BINDER__ASSEMBLY_NAME_INL__ |
17 | |
18 | SString &AssemblyName::GetSimpleName() |
19 | { |
20 | return m_simpleName; |
21 | } |
22 | |
23 | void AssemblyName::SetSimpleName(SString &simpleName) |
24 | { |
25 | m_simpleName.Set(simpleName); |
26 | SetHave(AssemblyIdentity::IDENTITY_FLAG_SIMPLE_NAME); |
27 | } |
28 | |
29 | AssemblyVersion *AssemblyName::GetVersion() |
30 | { |
31 | return &m_version; |
32 | } |
33 | |
34 | void AssemblyName::SetVersion(AssemblyVersion *pAssemblyVersion) |
35 | { |
36 | m_version.SetVersion(pAssemblyVersion); |
37 | } |
38 | |
39 | SString &AssemblyName::GetCulture() |
40 | { |
41 | return m_cultureOrLanguage; |
42 | } |
43 | |
44 | void AssemblyName::SetCulture(SString &culture) |
45 | { |
46 | m_cultureOrLanguage.Set(culture); |
47 | SetHave(AssemblyIdentity::IDENTITY_FLAG_CULTURE); |
48 | } |
49 | |
50 | SBuffer &AssemblyName::GetPublicKeyTokenBLOB() |
51 | { |
52 | return m_publicKeyOrTokenBLOB; |
53 | } |
54 | |
55 | PEKIND AssemblyName::GetArchitecture() |
56 | { |
57 | return m_kProcessorArchitecture; |
58 | } |
59 | |
60 | void AssemblyName::SetArchitecture(PEKIND kArchitecture) |
61 | { |
62 | m_kProcessorArchitecture = kArchitecture; |
63 | |
64 | if (kArchitecture != peNone) |
65 | { |
66 | SetHave(AssemblyIdentity::IDENTITY_FLAG_PROCESSOR_ARCHITECTURE); |
67 | } |
68 | else |
69 | { |
70 | SetClear(AssemblyIdentity::IDENTITY_FLAG_PROCESSOR_ARCHITECTURE); |
71 | } |
72 | } |
73 | |
74 | AssemblyContentType AssemblyName::GetContentType() |
75 | { |
76 | return m_kContentType; |
77 | } |
78 | |
79 | void AssemblyName::SetContentType(AssemblyContentType kContentType) |
80 | { |
81 | m_kContentType = kContentType; |
82 | |
83 | if (kContentType != AssemblyContentType_Default) |
84 | { |
85 | SetHave(AssemblyIdentity::IDENTITY_FLAG_CONTENT_TYPE); |
86 | } |
87 | else |
88 | { |
89 | SetClear(AssemblyIdentity::IDENTITY_FLAG_CONTENT_TYPE); |
90 | } |
91 | } |
92 | |
93 | BOOL AssemblyName::GetIsRetargetable() |
94 | { |
95 | return m_dwIdentityFlags & AssemblyIdentity::IDENTITY_FLAG_RETARGETABLE; |
96 | } |
97 | |
98 | void AssemblyName::SetIsRetargetable(BOOL fIsRetargetable) |
99 | { |
100 | if (fIsRetargetable) |
101 | { |
102 | m_dwNameFlags |= NAME_FLAG_RETARGETABLE; |
103 | SetHave(AssemblyIdentity::IDENTITY_FLAG_RETARGETABLE); |
104 | } |
105 | else |
106 | { |
107 | m_dwNameFlags &= ~NAME_FLAG_RETARGETABLE; |
108 | SetClear(AssemblyIdentity::IDENTITY_FLAG_RETARGETABLE); |
109 | } |
110 | } |
111 | |
112 | BOOL AssemblyName::GetIsDefinition() |
113 | { |
114 | return ((m_dwNameFlags & NAME_FLAG_DEFINITION) != 0); |
115 | } |
116 | |
117 | void AssemblyName::SetIsDefinition(BOOL fIsDefinition) |
118 | { |
119 | if (fIsDefinition) |
120 | { |
121 | m_dwNameFlags |= NAME_FLAG_DEFINITION; |
122 | } |
123 | else |
124 | { |
125 | m_dwNameFlags &= ~NAME_FLAG_DEFINITION; |
126 | } |
127 | } |
128 | |
129 | void AssemblyName::SetHave(DWORD dwIdentityFlags) |
130 | { |
131 | AssemblyIdentity::SetHave(dwIdentityFlags); |
132 | } |
133 | |
134 | BOOL AssemblyName::HaveAssemblyVersion() |
135 | { |
136 | return m_version.HasMajor(); |
137 | } |
138 | |
139 | BOOL AssemblyName::HaveNeutralCulture() |
140 | { |
141 | return GetDeNormalizedCulture().IsEmpty(); |
142 | } |
143 | |
144 | #endif |
145 |