C# Класс Pchp.CodeAnalysis.NameUtils

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AsVarName ( string varname ) : string

Gets variable name without leading $.

ClrName ( this qname ) : string

Gets CLR name using dot as a name separator.

GetNamingContext ( NamespaceDecl ns, SourceUnit unit ) : NamingContext

Create naming context.

GetNamingContext ( TypeDecl type ) : NamingContext

Create naming context in context of given type declaration.

GetNamingContext ( this routine ) : NamingContext

Create naming context.

IsEmpty ( this qname ) : bool

Gets value indicating whether given qualified name was not set.

IsGlobalVar ( ItemUse itemUse ) : bool

Gets value indicating whether the expression is in form of $GLOBALS[...].

MakeQualifiedName ( Name name, NamespaceDecl ns ) : QualifiedName

Combines name and its namespace.

MakeQualifiedName ( string name, bool fullyQualified ) : QualifiedName

Make QualifiedName from the string like AAA\BBB\XXX

MakeQualifiedName ( this type ) : QualifiedName

Gets full qualified name of the type declaration.

NamesEquals ( this names1, Name names2 ) : bool

Compares two arrays.

TryGetGlobalVarName ( ItemUse itemUse, VariableName &varname ) : bool

Tries to resolve global variable name from array item use. (eg. $GLOBALS["varname"]).

Описание методов

AsVarName() публичный статический Метод

Gets variable name without leading $.
public static AsVarName ( string varname ) : string
varname string String in form of $varname or $GLOBALS['varname'] or 'varname'
Результат string

ClrName() публичный статический Метод

Gets CLR name using dot as a name separator.
public static ClrName ( this qname ) : string
qname this
Результат string

GetNamingContext() публичный статический Метод

Create naming context.
public static GetNamingContext ( NamespaceDecl ns, SourceUnit unit ) : NamingContext
ns NamespaceDecl Current namespace declaration. In case it is null, context for global code is created.
unit SourceUnit Global code used when is null.
Результат NamingContext

GetNamingContext() публичный статический Метод

Create naming context in context of given type declaration.
public static GetNamingContext ( TypeDecl type ) : NamingContext
type TypeDecl
Результат NamingContext

GetNamingContext() публичный статический Метод

Create naming context.
public static GetNamingContext ( this routine ) : NamingContext
routine this
Результат NamingContext

IsEmpty() публичный статический Метод

Gets value indicating whether given qualified name was not set.
public static IsEmpty ( this qname ) : bool
qname this
Результат bool

IsGlobalVar() публичный статический Метод

Gets value indicating whether the expression is in form of $GLOBALS[...].
public static IsGlobalVar ( ItemUse itemUse ) : bool
itemUse ItemUse
Результат bool

MakeQualifiedName() публичный статический Метод

Combines name and its namespace.
public static MakeQualifiedName ( Name name, NamespaceDecl ns ) : QualifiedName
name Name Name.
ns NamespaceDecl Can be null.
Результат QualifiedName

MakeQualifiedName() публичный статический Метод

Make QualifiedName from the string like AAA\BBB\XXX
public static MakeQualifiedName ( string name, bool fullyQualified ) : QualifiedName
name string
fullyQualified bool
Результат QualifiedName

MakeQualifiedName() публичный статический Метод

Gets full qualified name of the type declaration.
public static MakeQualifiedName ( this type ) : QualifiedName
type this Type, cannot be null.
Результат QualifiedName

NamesEquals() публичный статический Метод

Compares two arrays.
public static NamesEquals ( this names1, Name names2 ) : bool
names1 this
names2 Name
Результат bool

TryGetGlobalVarName() публичный статический Метод

Tries to resolve global variable name from array item use. (eg. $GLOBALS["varname"]).
public static TryGetGlobalVarName ( ItemUse itemUse, VariableName &varname ) : bool
itemUse ItemUse
varname VariableName
Результат bool