This class is defined in Utilities.h and provides helper methods that make it easier to work with strings:

static inline int CompareIgnore(LPCWSTR first, LPCWSTR second)

This method compares two strings while ignoring case (see Table 9).

Table 9. StringUtil Helper Class

Returns

Description

0

Strings match, ignoring case

<0

First < second

>0

First > second

 

Here is an example:

static inline std::wstring Format(LPCWSTR input, int index, LPCWSTR value)

static inline std::wstring Format(LPCWSTR input, int index, DWORD value)

These methods are a bit like the Microsoft .NET Format methods in the sense that parameters are in the form of {0}. However, they do not perform any formatting of the input—just substitution:

static inline std::wstring Printf(std::wstring format, I val)

static inline std::wstring Printf(std::wstring format, I val1, J val2)

static inline std::wstring Printf(std::wstring format, I val1, J val2, K val3)

static inline std::wstring Printf(std::wstring format, I val1, J val2, K val3, L val4)

These are wrappers around the StringCchPrintf that return a wstring so you do not have to allocate memory for strings or buffers yourself.

Related Topics

Wizard Page Helper Classes