Partager via


vcCMNameValidationOption Enum

Definition

Provides name validation options.

public enum class vcCMNameValidationOption
public enum class vcCMNameValidationOption
enum vcCMNameValidationOption
[System.Runtime.InteropServices.Guid("7ED7D03E-0D4A-4E29-9B36-F90BEBCA2D83")]
public enum vcCMNameValidationOption
[<System.Runtime.InteropServices.Guid("7ED7D03E-0D4A-4E29-9B36-F90BEBCA2D83")>]
type vcCMNameValidationOption = 
Public Enum vcCMNameValidationOption
Inheritance
vcCMNameValidationOption
Attributes

Fields

Name Value Description
vcCMNameValidationOptionStandard 0

Checks the uniqueness of the name. This is used internally for functions, macros, and namespaces.

vcCMNameValidationOptionPartial 1

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.

vcCMNameValidationOptionDefinition 2

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 3

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.

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.

Applies to