CHString class (chstring.h)

[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.]

Methods

The CHString class has these methods.

 
CHString::AllocSysString

The AllocSysString method allocates a new BSTR string that is Automation compatible. It then copies the contents of the CHStringstring into it, including the terminating NULL character.
CHString::CHString

The CHString::CHString function initializes a new CHString object with the specified data.
CHString::CHString

Initializes a new CHString object with the specified data. (overload 2/6)
CHString::CHString

Initializes a new CHString object with the specified data. (overload 4/6)
CHString::CHString

Initializes a new CHString object with the specified data. (overload 5/6)
CHString::CHString

Initializes a new CHString object with the specified data. (overload 1/6)
CHString::CHString

Initializes a new CHString object with the specified data. (overload 6/6)
CHString::CHString

Initializes a new CHString object with the specified data. (overload 3/6)
CHString::Collate

The Collate method uses the wcscoll function to compare a CHString string with another string.
CHString::Compare

The Compare method uses the wcscmp function to compare this CHString string with another string.
CHString::CompareNoCase

The CompareNoCase method uses the _wcsicmp function to compare a CHString string with another string.
CHString::Empty

The Empty method makes the CHString object an empty string and frees memory as appropriate.
CHString::Find

The Find method searches a string for the first match of a substring.
CHString::Find

The CHString::Find method searches a string for the first match of a substring.
CHString::FindOneOf

The FindOneOf method searches a string for the first character that matches any character contained in lpszCharSet.
CHString::Format

The CHString::Format method formats and stores a series of characters and values in a CHString.
CHString::Format

The CHString::Format method formats and stores a series of characters and values in a CHString string.
CHString::FormatMessageW

The CHString::FormatMessageW (Unicode) method formats a message string.
CHString::FormatMessageW

The CHString::FormatMessageW (Unicode) method formats a message string.
CHString::FormatV

The FormatV method writes a formatted string and a variable list of arguments to a CHString string.
CHString::FreeExtra

The FreeExtra method frees any extra memory that was previously allocated by the string but is no longer needed.
CHString::GetAllocLength

The GetAllocLength method returns the size of the allocated string buffer.
CHString::GetAt

The CHString::GetAt(int) (chstring.h) method returns a single character specified by an index number.
CHString::GetAt

The CHString::GetAt (chstring.h) method returns a single character specified by an index number.
CHString::GetBuffer

The GetBuffer method returns a pointer to the internal character buffer for the CHString object.
CHString::GetBufferSetLength

The GetBufferSetLength method returns a pointer to the internal character buffer for the CHString object, truncating or increasing its length if necessary to exactly match the length specified in nNewLength.
CHString::GetData

The GetData method to get the data from the CHString object.
CHString::GetLength

The GetLength method gets a count of the number of wide characters in this CHString string. The count does not include a NULL terminator.
CHString::IsEmpty

The IsEmpty method tests a CHString string for the empty condition.
CHString::Left

Extracts the first nCount characters from a CHString string and returns a copy of the extracted substring.
CHString::LoadStringW

The LoadStringW method reads a Windows string resource (identified by nID) into an existing CHString object. (overload 1/2)
CHString::LoadStringW

The LoadStringW method reads a Windows string resource (identified by nID) into an existing CHString object. (overload 2/2)
CHString::LockBuffer

The LockBuffer method locks a string in the buffer.
CHString::MakeLower

The MakeLower method converts a CHString string to a lowercase string.
CHString::MakeReverse

The MakeReverse method reverses the order of the characters in a CHString string.
CHString::MakeUpper

The MakeUpper method converts a CHString string to an uppercase string.
CHString::Mid

The Mid method extracts a substring of length nCount characters from a CHString string, starting at position nFirst (zero-based). The method returns a copy of the extracted substring.
CHString::Mid

The CHString::Mid method extracts a substring of length nCount characters from a CHString string, starting at position nFirst (zero-based).
CHString::operator LPCWSTR

The operator LPCWSTR conversion operator provides an efficient method to access the NULL-terminated C string contained in a CHString object.
CHString::ReleaseBuffer

Ends the use of a buffer allocated by GetBuffer.
CHString::ReverseFind

The ReverseFind method searches a CHString string for the last match of a substring. This method is similar to the runtime function, wcsrchr.
CHString::Right

Extracts the last nCount characters from a CHString string and returns a copy of the extracted substring.
CHString::SetAt

Overwrites one character specified by an index number.
CHString::SpanExcluding

The SpanExcluding method extracts and returns all characters preceding the first occurrence of a character from lpszCharSet.
CHString::SpanIncluding

The SpanIncluding method extracts characters of a string that are identified by lpszCharSet.
CHString::TrimLeft

The TrimLeft method trims leading whitespace characters from the string by removing new line, space, and tab characters.
CHString::TrimRight

The TrimRight method trims trailing whitespace characters from the string by removing trailing newline, space, and tab characters.
CHString::UnlockBuffer

The UnlockBuffer method unlocks the buffer that was previously secured by calling LockBuffer and resets the reference count to 1.

Remarks

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

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header chstring.h (include FwCommon.h)