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
18SString &AssemblyName::GetSimpleName()
19{
20 return m_simpleName;
21}
22
23void AssemblyName::SetSimpleName(SString &simpleName)
24{
25 m_simpleName.Set(simpleName);
26 SetHave(AssemblyIdentity::IDENTITY_FLAG_SIMPLE_NAME);
27}
28
29AssemblyVersion *AssemblyName::GetVersion()
30{
31 return &m_version;
32}
33
34void AssemblyName::SetVersion(AssemblyVersion *pAssemblyVersion)
35{
36 m_version.SetVersion(pAssemblyVersion);
37}
38
39SString &AssemblyName::GetCulture()
40{
41 return m_cultureOrLanguage;
42}
43
44void AssemblyName::SetCulture(SString &culture)
45{
46 m_cultureOrLanguage.Set(culture);
47 SetHave(AssemblyIdentity::IDENTITY_FLAG_CULTURE);
48}
49
50SBuffer &AssemblyName::GetPublicKeyTokenBLOB()
51{
52 return m_publicKeyOrTokenBLOB;
53}
54
55PEKIND AssemblyName::GetArchitecture()
56{
57 return m_kProcessorArchitecture;
58}
59
60void 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
74AssemblyContentType AssemblyName::GetContentType()
75{
76 return m_kContentType;
77}
78
79void 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
93BOOL AssemblyName::GetIsRetargetable()
94{
95 return m_dwIdentityFlags & AssemblyIdentity::IDENTITY_FLAG_RETARGETABLE;
96}
97
98void 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
112BOOL AssemblyName::GetIsDefinition()
113{
114 return ((m_dwNameFlags & NAME_FLAG_DEFINITION) != 0);
115}
116
117void 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
129void AssemblyName::SetHave(DWORD dwIdentityFlags)
130{
131 AssemblyIdentity::SetHave(dwIdentityFlags);
132}
133
134BOOL AssemblyName::HaveAssemblyVersion()
135{
136 return m_version.HasMajor();
137}
138
139BOOL AssemblyName::HaveNeutralCulture()
140{
141 return GetDeNormalizedCulture().IsEmpty();
142}
143
144#endif
145