C# Класс YAXLib.StringUtils

Provides string utility methods
Показать файл Открыть проект

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

Метод Описание
CombineLocationAndElementName ( string location, System.Xml.Linq.XName elemName ) : string

Combines a location string and an element name to form a bigger location string.

DivideLocationOneStep ( string location, string &newLocation, string &newElem ) : bool

Divides the location string one step, to form a shorter location string.

ExttractPathAndAliasFromLocationString ( string locationString, string &path, string &alias ) : void

Extracts the path and alias from location string. A pure path location string: level1/level2 A location string augmented with alias: level1/level2#somename Here path is "level1/level2" and alias is "somename".

GetArrayDimsString ( int dims ) : string

Gets the string corresponidng to the given array dimensions.

IsLocationAllGeneric ( string location ) : bool

Determines whether the specified location is composed of levels which are themselves either "." or "..".

IsSingleLocationGeneric ( string location ) : bool

Determines whether the specified location string is either "." or "..".

LooksLikeExpandedXName ( string name ) : bool

Heuristically determines if the supplied name conforms to the "expanded XML name" form supported by the System.Xml.Linq.XName class.

ParseArrayDimsString ( string str ) : int[]

Parses the array dimensions string, and returns the corresponding dimensions array.

ParseDateTimeTimeZoneSafe ( string str, IFormatProvider formatProvider ) : System.DateTime
RefineLocationString ( string elemAddr ) : string

Refines the location string. Trims it, and replaces invlalid characters with underscore.

RefineSingleElement ( string elemName ) : string

Refines a single element name. Refines the location string. Trims it, and replaces invlalid characters with underscore.

SplitPathNamespaceSafe ( this value ) : IEnumerable

Splits a string at each instance of a '/' except where such slashes are within {}.

Приватные методы

Метод Описание
IsInRange ( char ch, char lower, char upper ) : bool
IsValidNameChar ( char ch ) : bool
IsValidNameStartChar ( char ch ) : bool

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

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

Combines a location string and an element name to form a bigger location string.
public static CombineLocationAndElementName ( string location, System.Xml.Linq.XName elemName ) : string
location string The location string.
elemName System.Xml.Linq.XName Name of the element.
Результат string

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

Divides the location string one step, to form a shorter location string.
public static DivideLocationOneStep ( string location, string &newLocation, string &newElem ) : bool
location string The location string to divide.
newLocation string The new location string which is one level shorter.
newElem string The element name removed from the end of location string.
Результат bool

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

Extracts the path and alias from location string. A pure path location string: level1/level2 A location string augmented with alias: level1/level2#somename Here path is "level1/level2" and alias is "somename".
public static ExttractPathAndAliasFromLocationString ( string locationString, string &path, string &alias ) : void
locationString string The location string.
path string The path to be extracted.
alias string The alias to be extracted.
Результат void

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

Gets the string corresponidng to the given array dimensions.
public static GetArrayDimsString ( int dims ) : string
dims int The array dimensions.
Результат string

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

Determines whether the specified location is composed of levels which are themselves either "." or "..".
public static IsLocationAllGeneric ( string location ) : bool
location string The location string to check.
Результат bool

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

Determines whether the specified location string is either "." or "..".
public static IsSingleLocationGeneric ( string location ) : bool
location string The location string to check.
Результат bool

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

Heuristically determines if the supplied name conforms to the "expanded XML name" form supported by the System.Xml.Linq.XName class.
public static LooksLikeExpandedXName ( string name ) : bool
name string The name to be examined.
Результат bool

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

Parses the array dimensions string, and returns the corresponding dimensions array.
public static ParseArrayDimsString ( string str ) : int[]
str string The string to parse.
Результат int[]

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

public static ParseDateTimeTimeZoneSafe ( string str, IFormatProvider formatProvider ) : System.DateTime
str string
formatProvider IFormatProvider
Результат System.DateTime

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

Refines the location string. Trims it, and replaces invlalid characters with underscore.
public static RefineLocationString ( string elemAddr ) : string
elemAddr string The element address to refine.
Результат string

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

Refines a single element name. Refines the location string. Trims it, and replaces invlalid characters with underscore.
public static RefineSingleElement ( string elemName ) : string
elemName string Name of the element.
Результат string

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

Splits a string at each instance of a '/' except where such slashes are within {}.
public static SplitPathNamespaceSafe ( this value ) : IEnumerable
value this The string to split
Результат IEnumerable