CHString class

[The CHString class is part of the WMI Provider Framework, which is no longer available for use as of Windows Vista. Instead, see Using WMI for the preferred ways to write a WMI COM provider or a WMI provider that uses the .NET Framework System.Management namespaces.]

The following table lists the CHString methods.

Members

The CHString class has these types of members:

Constructors

The CHString class has these constructors.

ConstructorDescription
CHString

Constructs CHString strings in various ways.

 

Methods

The CHString class has these methods.

MethodDescription
AllocSysString

Allocates a BSTR from CHString data.

Collate

Compares two strings (case sensitive; uses locale-specific information).

Compare

Compares two strings (case sensitive).

CompareNoCase

Compares two strings (case insensitive).

Empty

Forces a string to have 0 (zero) length.

Find Overloaded.

Finds a character or substring inside a larger string.

FindOneOf

Finds the first matching character from a set.

Format Overloaded.

Formats the string as sprintf does.

FormatMessageW Overloaded.

Formats a message string.

FormatV

Formats the string as vsprintf does.

FreeExtra

Removes any overhead of this string by freeing any extra memory previously allocated to the string.

GetAllocLength

Returns the size of the string buffer.

GetAt Overloaded.

Returns the character at a given position.

GetBuffer

Returns a pointer to the characters in the CHString string.

GetBufferSetLength

Returns a pointer to the characters in the CHString string, truncating to the specified length.

GetData

Returns a pointer to the data in the CHString string.

GetLength

Returns the number of Unicode characters in a CHString string.

IsEmpty

Tests whether a CHString string contains no characters.

Left

Extracts the left part of a string (like the Basic LEFT$ function).

LoadStringW

Loads an existing CHString string from a resource file.

LockBuffer

Disables reference counting and protects the string in the buffer.

MakeLower

Converts all of the characters in this string to lowercase characters.

MakeReverse

Reverses the characters in this string.

MakeUpper

Converts all of the characters in this string to uppercase characters.

Mid Overloaded.

Extracts the middle part of a string (like the Basic MID$ function).

ReleaseBuffer

Releases control of the buffer returned by GetBuffer.

ReverseFind

Finds a character inside a larger string; starts from the end.

Right

Extracts the right part of a string (like the Basic RIGHT$ function).

SetAt

Sets a character at a given position.

SpanExcluding

Extracts a substring that contains only the characters that are not in the set.

SpanIncluding

Extracts a substring that contains only the characters in a set.

TrimLeft

Trims leading whitespace characters from the string.

TrimRight

Trims trailing whitespace characters from the string.

UnlockBuffer

Enables reference counting and releases the string in the buffer.

 

Operators

The CHString class has these operators.

OperatorDescription
operator != (CHString, CHString)

Compares two CHStrings for inequality.

operator != (CHString, LPCWSTR)

Compares a CHString with a LPCWSTR for inequality.

operator []

Returns the character at a given position — operator substitution for GetAt.

operator +

Concatenates two strings and returns a new string.

operator +=

Concatenates a new string to the end of an existing string.

operator < (CHString, LPCWSTR)

Compares a CHString with a LPCWSTR.

operator < (CHString, CHString)

Compares two CHStrings.

operator <= (CHString, CHString)

Compares two CHStrings.

operator <= (CHString, LPCWSTR)

Compares a CHString with a LPCWSTR.

operator =

Assigns a new value to a CHString string.

operator == (CHString, CHString)

Compares two CHStrings for equality.

operator == (CHString, LPCWSTR)

Compares a CHString with a LPCWSTR for equality.

operator > (CHString, CHString)

Compares two CHStrings.

operator > (CHString, LPCWSTR)

Compares a CHString with a LPCWSTR.

operator >= (CHString, CHString)

Compares two CHStrings.

operator >= (CHString, LPCWSTR)

Compares a CHString with a LPCWSTR.

operator LPCWSTR

Directly accesses characters stored in a CHString string as a C-style string.

 

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003

End of client support

None supported

End of server support

Windows Server 2003

Header

Chstring.h (include FwCommon.h)

Library

Framedyn.lib

DLL

Framedyn.dll

 

 

Show:
© 2014 Microsoft