| 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.hpp |
| 7 | // |
| 8 | |
| 9 | |
| 10 | // |
| 11 | // Defines the AssemblyName class |
| 12 | // |
| 13 | // ============================================================ |
| 14 | |
| 15 | #ifndef __BINDER__ASSEMBLY_NAME_HPP__ |
| 16 | #define __BINDER__ASSEMBLY_NAME_HPP__ |
| 17 | |
| 18 | #include "bindertypes.hpp" |
| 19 | #include "assemblyidentity.hpp" |
| 20 | |
| 21 | namespace BINDER_SPACE |
| 22 | { |
| 23 | class AssemblyName : protected AssemblyIdentity |
| 24 | { |
| 25 | public: |
| 26 | typedef enum |
| 27 | { |
| 28 | INCLUDE_DEFAULT = 0x00, |
| 29 | INCLUDE_VERSION = 0x01, |
| 30 | INCLUDE_ARCHITECTURE = 0x02, |
| 31 | INCLUDE_RETARGETABLE = 0x04, |
| 32 | INCLUDE_CONTENT_TYPE = 0x08, |
| 33 | INCLUDE_PUBLIC_KEY_TOKEN = 0x10, |
| 34 | EXCLUDE_CULTURE = 0x20 |
| 35 | } INCLUDE_FLAGS; |
| 36 | |
| 37 | AssemblyName(); |
| 38 | ~AssemblyName(); |
| 39 | |
| 40 | HRESULT Init(/* in */ IMDInternalImport *pIMetaDataAssemblyImport, |
| 41 | /* in */ PEKIND PeKind, |
| 42 | /* in */ mdAssemblyRef mda = 0, |
| 43 | /* in */ BOOL fIsDefinition = TRUE); |
| 44 | HRESULT Init(/* in */ SString &assemblyDisplayName); |
| 45 | HRESULT Init(/* in */ IAssemblyName *pIAssemblyName); |
| 46 | HRESULT CreateFusionName(/* out */ IAssemblyName **ppIAssemblyName); |
| 47 | |
| 48 | ULONG AddRef(); |
| 49 | ULONG Release(); |
| 50 | |
| 51 | // Getters/Setters |
| 52 | inline SString &GetSimpleName(); |
| 53 | inline void SetSimpleName(SString &simpleName); |
| 54 | inline AssemblyVersion *GetVersion(); |
| 55 | inline void SetVersion(/* in */ AssemblyVersion *pAssemblyVersion); |
| 56 | inline SString &GetCulture(); |
| 57 | inline void SetCulture(SString &culture); |
| 58 | inline SBuffer &GetPublicKeyTokenBLOB(); |
| 59 | inline PEKIND GetArchitecture(); |
| 60 | inline void SetArchitecture(PEKIND kArchitecture); |
| 61 | inline AssemblyContentType GetContentType(); |
| 62 | inline void SetContentType(AssemblyContentType kContentType); |
| 63 | inline BOOL GetIsRetargetable(); |
| 64 | inline void SetIsRetargetable(BOOL fIsRetargetable); |
| 65 | inline BOOL GetIsDefinition(); |
| 66 | inline void SetIsDefinition(BOOL fIsDefinition); |
| 67 | |
| 68 | inline void SetHave(DWORD dwIdentityFlags); |
| 69 | |
| 70 | inline BOOL HaveAssemblyVersion(); |
| 71 | inline BOOL HaveNeutralCulture(); |
| 72 | |
| 73 | SString &GetDeNormalizedCulture(); |
| 74 | BOOL IsStronglyNamed(); |
| 75 | |
| 76 | BOOL IsMscorlib(); |
| 77 | |
| 78 | // Translate textual identity into appropriate PEKIND |
| 79 | HRESULT SetArchitecture(SString &architecture); |
| 80 | |
| 81 | ULONG Hash(/* in */ DWORD dwIncludeFlags); |
| 82 | BOOL Equals(/* in */ AssemblyName *pAssemblyName, |
| 83 | /* in */ DWORD dwIncludeFlags); |
| 84 | |
| 85 | // Compare assembly ref with assembly def ignoring assembly version |
| 86 | BOOL RefEqualsDef(/* in */ AssemblyName *pAssemblyNameDef, |
| 87 | /* in */ BOOL fInspectionOnly); |
| 88 | |
| 89 | HRESULT Clone(/* out */ AssemblyName **ppAssemblyName); |
| 90 | |
| 91 | void GetDisplayName(/* out */ PathString &displayName, |
| 92 | /* in */ DWORD dwIncludeFlags); |
| 93 | |
| 94 | static SString &ArchitectureToString(PEKIND kArchitecture); |
| 95 | protected: |
| 96 | enum |
| 97 | { |
| 98 | NAME_FLAG_NONE = 0x00, |
| 99 | NAME_FLAG_RETARGETABLE = 0x01, |
| 100 | NAME_FLAG_DEFINITION = 0x02, |
| 101 | }; |
| 102 | |
| 103 | SString &GetNormalizedCulture(); |
| 104 | |
| 105 | LONG m_cRef; |
| 106 | DWORD m_dwNameFlags; |
| 107 | }; |
| 108 | |
| 109 | #include "assemblyname.inl" |
| 110 | }; |
| 111 | |
| 112 | #endif |
| 113 | |