Partager via


vcCMNameValidationOption Enumeration

Provides name validation options.

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

Syntax

'Declaration
<GuidAttribute("435D25EA-AE4E-431E-ADAC-C1E5ADA65E1E")> _
Public Enumeration vcCMNameValidationOption
[GuidAttribute("435D25EA-AE4E-431E-ADAC-C1E5ADA65E1E")]
public enum vcCMNameValidationOption
[GuidAttribute(L"435D25EA-AE4E-431E-ADAC-C1E5ADA65E1E")]
public enum class vcCMNameValidationOption
[<GuidAttribute("435D25EA-AE4E-431E-ADAC-C1E5ADA65E1E")>]
type vcCMNameValidationOption
public enum vcCMNameValidationOption

Members

Member name Description
vcCMNameValidationOptionDefinition Used for code items that can be forward-declared, mainly classes and functions. When the Code Model checks the uniqueness of the name, it skips items that are declarations-only and looks only for definitions. If the user has a declared but undefined function void Function1();, then adding a new function void Function() {} won’t result in an error since the definition is not duplicated. The validation fails if a duplicate function with the same parameters is already defined.
vcCMNameValidationOptionForwardDeclaration Used for code items that are only forward declaration. Since there may be countless forward declarations for a single definition without a compiler error, this validation option checks only the validity of the name and nothing else.
vcCMNameValidationOptionPartial Checks the non-uniqueness of the name. It is used only for partial classes. Partial classes must have a main class in order to be visible to the Code Model. To access a partial class MyClass, it is necessary to get the actual class MyClass, and then enumerate all of its parts by calling the get_Parts() method Because of this, the Code Model prevents the user from renaming partial class MyClass to partial class YourClass unless there is already a class YourClass, because otherwise the resulting object won’t be accessible and the code won’t compile.
vcCMNameValidationOptionStandard Checks the uniqueness of the name. This is used internally for functions, macros, and namespaces.

Remarks

This enumeration is used when any name-validating operations are performed. When a new identifier is created or an existing identifier (including classes, functions, variables, etc.) is renamed, the Code Model checks for the existence of another object with the same name. All the validation options check the validity of the new name. According to the rules of C++, only identifiers that contain alphanumeric characters and underscores (and an occasional tilde) are allowed.

See Also

Reference

Microsoft.VisualStudio.VCCodeModel Namespace