VCLanguageManager Interface

 

An object used to validate various code elements of a C++ source file.

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

[GuidAttribute("8D82CD65-79C3-4A47-A39E-F0ACB5AD2C91")]
public interface VCLanguageManager

NameDescription
System_CAPS_pubmethodCompareTokenStreams(String, String)

Compares two text streams token-wise (skipping comments and whitechars).

System_CAPS_pubmethodIsReservedName(String, Boolean)

Determines if the specified name is a C++ reserved name.

System_CAPS_pubmethodRefreshUserKeywords(String)

Refreshes the user-defined keywords from a file.

System_CAPS_pubmethodValidateFileName(String, vsCMValidateFileExtension)

Determines if the specified file name is a valid C++ file name.

System_CAPS_pubmethodValidateIdentifier(String)

Determines if the specified name is a valid C++ identifier.

System_CAPS_pubmethodValidateParameterNames(String, String, vsCMElement)

Determines if the specified parameter list is valid.

System_CAPS_pubmethodValidateQualifiedName(String)

Determines if the specified name is a valid C++ qualified name.

System_CAPS_pubmethodValidateType(String)

Determines if the specified expression is a valid C++ type expression.

The VCLanguageManager object allows validation of various code elements in a C++ source file, such as variable names, qualified names, C++ source file names, and so on.

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

This example validates the name of a possible C++ source file. This sample assumes that a file, MyFile.cpp, exists in the current solution directory.

Sub ValidateFileName()
    Dim vcCM as VCCodeModel
    vcCM = DTE.Solution.Item(1).CodeModel
    if(DTE.VCLanguageManager.ValidateFileName("MyFile.cpp")) Then
        DTE.Solution.Item(1).ProjectItems.AddFromFile("MyFile.cpp")
End Sub
Return to top
Show: