CHString class

[The CHString class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The following table lists the CHString methods.

Members

The CHString class has these types of members:

Constructors

The CHString class has these constructors.

Constructor Description
CHString Constructs CHString strings in various ways.

Methods

The CHString class has these methods.

Method Description
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.

Operator Description
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.

Remarks

The destructor for the class is CHString::~CHString.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
ChString.h (include FwCommon.h)
Library
FrameDyn.lib
DLL
FrameDynOS.dll;
FrameDyn.dll