//---------------------------------------------------------------------------------------------------------------------- /// \file /// /// Wex String classes. Use the String class in exception-throwing environments, /// and the NoThrowString class in non exception-throwing environments. The NoThrowString /// class is an exception-safe wrapper around the String class. /// /// /// When using the String class, you must be sure that you are handling WEX::Common::Exceptions around any /// non-const member function calls. /// /// When using the NoThrowString class, you should call IsValid after every call to a non-const /// member function in order to check that the string contents are still valid. /// You can also call GetLastHResult() for more information. /// // Copyright (c) Microsoft Corporation. All Rights Reserved. //---------------------------------------------------------------------------------------------------------------------- #if !defined(__WEXSTRING_H__) && defined(_WIN32) #define __WEXSTRING_H__ #include "Wex.Common.h" #include "WexTypes.h" #include #include /// \namespace WEX::Common /// /// The WEX::Common namespace contains fundamental declarations. /// namespace WEX { namespace Common { class NoThrowString; /// /// Wex String classes. Use the String class in exception-throwing environments, /// and the NoThrowString class in non exception-throwing environments. The NoThrowString /// class is an exception-safe wrapper around the String class. /// class WEXCOMMON_API String { friend class NoThrowString; public: /// Constructs an empty String. String(); /// Constructs a String with the same contents as the specified NoThrowString. /// The NoThrowString instance to copy the contents from. String(const NoThrowString& str); /// /// String(_In_opt_z_ wchar_t* psz); /// Constructs a String object, and copies the requested number of characters from the specified wchar_t* /// /// String(_In_reads_or_z_opt_(count) const wchar_t* psz, int count); /// /// String(_In_opt_z_ char* psz); /// /// String(_In_opt_z_ const wchar_t* psz); /// /// String(_In_opt_z_ const char* psz); /// Destroys the String free'ing all associated resources. ~String(); /// Move constructor /// String(String&& str); // Copy constructor /// /// String(const String& str); // Assignment /// Move assignment operator from NoThrowString. If the NoThrowString is not valid, the String remains unchanged. /// const String& operator =(NoThrowString&& strSrc); /// /// const String& operator =(String strSrc); /// Copy assignment operator from NoThrowString. If the NoThrowString is not valid, the String remains unchanged. /// const String& operator =(const NoThrowString& strSrc); /// /// const String& operator =(wchar_t ch); /// /// const String& operator =(char ch); /// /// const String& operator =(_In_opt_z_ const wchar_t* psz); /// /// const String& operator =(_In_opt_z_ const char* psz); /// /// const String& operator =(_In_opt_z_ const unsigned char* psz); // Appending (For concatenation, see outside of the class definition below) /// /// const String& operator +=(const String& str); /// /// /// const String& operator +=(wchar_t ch); /// /// const String& operator +=(char ch); /// /// const String& operator +=(_In_z_ const wchar_t* psz); // Conversion operator const wchar_t*() const; // Helper Methods /// Append a specified string to an existing String /// The String to append. /// String& Append(const String& strSrc); /// Append a specified string to an existing String /// String& Append(_In_z_ const wchar_t* pszSrc); /// Append a given character to this string /// String& Append(wchar_t ch); /// Append a given character to this string /// String& Append(char ch); /// Appends formatted data to an existing string /// String& AppendFormat(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, ...); /// Appends formatted data to an existing string /// /// String& AppendFormatV(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, va_list args); /// Compares two strings (case sensitive) /// int Compare(_In_z_ const wchar_t* pszCompare) const; /// Compares two strings (case insensitive). /// int CompareNoCase(_In_z_ const wchar_t* pszCompare) const; /// Copies the requested number of characters from the specified wchar_t*. Allocates more space if necessary. /// /// void Copy(_In_reads_or_z_(count) const wchar_t* pszSrc, int count); /// Deletes a character or characters from a string /// /// int Delete(int index, int count = 1); /// Empties the string void Empty(); /// Searches the string for the first match of the specified character /// /// The zero-based index of the first character in this String object that matches /// the requested character or -1 if the character is not found. int Find(wchar_t ch) const; /// Searches the string for the first match of the specified character /// /// /// The zero-based index of the first character in this String object after the start /// offset that matches the requested character or -1 if the character is not found. int Find(wchar_t ch, int start) const; /// Searches the string for the first match of the specified substring /// /// The zero-based index of the first substring in this String object that matches /// the requested substring or -1 if the substring is not found. int Find(_In_z_ const wchar_t* pszSub) const; /// Searches the string for the first match of the specified substring /// /// /// The zero-based index of the first substring in this String object after the start /// offset that matches the requested substring or -1 if the substring is not found. int Find(_In_z_ const wchar_t* pszSub, int start) const; /// Formats the string as swprintf does /// String& Format(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, ...); /// Formats the string as swprintf does /// /// String& FormatV(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, va_list args); /// Frees any extra memory previously allocated by the string but no longer needed void FreeExtra(); /// Returns the count of characters in the string int GetLength() const; /// Inserts a single character at the given index within the string /// /// int Insert(int index, wchar_t ch); /// Inserts a substring at the given index within the string /// /// int Insert(int index, _In_z_ const wchar_t* psz); /// Returns whether or not the string is empty bool IsEmpty() const; /// Returns a non-const pointer to the underlying string buffer. If you write to the buffer using this pointer, be sure to call ReleaseBuffer when finished. unsigned short* GetBuffer(); /// Returns a pointer to the internal character buffer for the String object, truncating or growing its length if necessary to exactly match the length specified in Length /// _Ret_writes_(length + 1) unsigned short* GetBufferSetLength(int length); /// Call this method to reallocate or free up the buffer of the string object, If you know that the string in the buffer is null terminated, you can omit the newLength argument. If your string is not null terminated, use newLength to specify its length. NOTE: The address returned by GetBuffer is invalid after the call to ReleaseBuffer /// void ReleaseBuffer(int newLength = -1); /// Extracts the first (leftmost) count characters from the string /// String Left(int count) const; /// Extracts a substring of length count characters, starting at position first /// /// String Mid(int first, int count) const; /// Extracts a substring of length count characters, starting at position first /// String Mid(int first) const; /// Removes instances of the specified character from the string /// int Remove(wchar_t removeChar); /// Replaces all instances of one character with another /// /// int Replace(wchar_t oldChar, wchar_t newChar); /// Replaces all instances of one substring with another /// /// int Replace(_In_z_ const wchar_t* pszOld, _In_z_ const wchar_t* pszNew); /// Reverses the order of characters in the string void Reverse(); /// Searches for a character inside a larger string; starts at the end of the string /// The zero-based index of the last character in this String object that matches the requested character, or -1 if the character is not found. /// The character to look for. int ReverseFind(wchar_t ch) const; /// Extracts the last (rightmost) count characters from the string /// String Right(int count) const; /// Converts all the characters in this string to lower-case String& ToLower(); /// Converts all the characters in this string to upper-case String& ToUpper(); /// Trims all leading and trailing whitespace, new line, tab and space characters from the string void Trim(); /// Trims all leading and trailing occurrences of character 'ch' void Trim(unsigned short ch); /// Trims all leading and trailing whitespace, new line, tab and space characters from the left portion of the string void TrimLeft(); /// Trims all leading and trailing whitespace, new line, tab and space characters from the right portion of the string void TrimRight(); /// Returns whether or not the specified const wchar_t* is null or an empty string /// The const wchar_t* to check. /// _Post_equal_to_(!psz || *psz == 0) static bool WEXCOMMON_STDCALL IsNullOrEmpty(_In_opt_z_ const wchar_t* psz) { return !psz || *psz == L'\0'; } // unsigned short exports #if defined(WEXCOMMON_FULL_BUILD) operator const unsigned short*() const; String(_In_opt_z_ unsigned short* psz); String(_In_reads_or_z_opt_(count) const unsigned short* psz, int count); String(_In_opt_z_ const unsigned short* psz); const String& operator =(unsigned short ch); const String& operator =(_In_opt_z_ const unsigned short* psz); const String& operator +=(unsigned short ch); const String& operator +=(_In_z_ const unsigned short* psz); String& Append(_In_z_ const unsigned short* pszSrc); String& Append(unsigned short ch); String& AppendFormat(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, ...); String& AppendFormatV(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, va_list args); int Compare(_In_z_ const unsigned short* pszCompare) const; int CompareNoCase(_In_z_ const unsigned short* pszCompare) const; void Copy(_In_reads_or_z_(count) const unsigned short* pszSrc, int count); int Find(unsigned short ch) const; int Find(unsigned short ch, int start) const; int Find(_In_z_ const unsigned short* pszSub) const; int Find(_In_z_ const unsigned short* pszSub, int start) const; String& Format(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, ...); String& FormatV(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, va_list args); int Insert(int index, unsigned short ch); int Insert(int index, _In_z_ const unsigned short* psz); int Remove(unsigned short removeChar); int Replace(unsigned short oldChar, unsigned short newChar); int Replace(_In_z_ const unsigned short* pszOld, _In_z_ const unsigned short* pszNew); int ReverseFind(unsigned short ch) const; static bool WEXCOMMON_STDCALL IsNullOrEmpty(const unsigned short* psz) { return IsNullOrEmpty(reinterpret_cast(psz)); } #endif // WEXCOMMON_FULL_BUILD private: friend WEXCOMMON_API int WEXCOMMON_STDCALL GetBufferLength(const String& string); friend WEXCOMMON_API void WEXCOMMON_STDCALL swap(String& str1, String& str2); // m_pReserved is not currently used. It exists to ensure the class has the size expected by code built against older TAEF headers. void* m_pReserved; wchar_t* m_psz; }; /// A function that retrieves the length of the allocated buffer backing a String instance. /// The String to retrieve the buffer length of. /// The length of the allocated buffer, in characters. WEXCOMMON_API int WEXCOMMON_STDCALL GetBufferLength(const String& string); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(const String& str1, const String& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(const String& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(_In_z_ const wchar_t* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(const String& str1, const String& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(const String& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(_In_z_ const wchar_t* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(const String& str1, const String& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(const String& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(_In_z_ const wchar_t* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(const String& str1, const String& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(const String& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(_In_z_ const wchar_t* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(const String& str1, const String& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(const String& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(_In_z_ const wchar_t* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(const String& str1, const String& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(const String& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(_In_z_ const wchar_t* psz, const String& str); // Concatenation /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(String str1, const String& str2); /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(String str, wchar_t ch); /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(wchar_t ch, const String& str); /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(String str, char ch); /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(char ch, const String& str); /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(String str, _In_z_ const wchar_t* lpsz); /// /// /// WEXCOMMON_API String WEXCOMMON_STDCALL operator+(_In_z_ const wchar_t* psz, const String& str); // unsigned short exports #if defined(WEXCOMMON_FULL_BUILD) WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(const String& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(_In_z_ const unsigned short* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(const String& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(_In_z_ const unsigned short* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(const String& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(_In_z_ const unsigned short* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(const String& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(_In_z_ const unsigned short* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(const String& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(_In_z_ const unsigned short* psz, const String& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(const String& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(_In_z_ const unsigned short* psz, const String& str); WEXCOMMON_API String WEXCOMMON_STDCALL operator+(String str, unsigned short ch); WEXCOMMON_API String WEXCOMMON_STDCALL operator+(unsigned short ch, const String& str); WEXCOMMON_API String WEXCOMMON_STDCALL operator+(String str, _In_z_ const unsigned short* lpsz); WEXCOMMON_API String WEXCOMMON_STDCALL operator+(_In_z_ const unsigned short* psz, const String& str); #endif WEXCOMMON_API void WEXCOMMON_STDCALL swap(String& str1, String& str2); /// /// Wex String classes. Use the String class in exception-throwing environments, /// and the NoThrowString class in non exception-throwing environments. The NoThrowString /// class is an exception-safe wrapper around the String class. /// class WEXCOMMON_API NoThrowString { friend class String; public: NoThrowString(); NoThrowString(const String& str); NoThrowString(_In_opt_z_ wchar_t* psz); NoThrowString(_In_reads_or_z_opt_(count) const wchar_t* psz, int count); // Constructs a NoThrowString object, and copies the requested number of characters from the specified wchar_t* NoThrowString(_In_opt_z_ char* psz); NoThrowString(_In_opt_z_ const wchar_t* psz); NoThrowString(_In_opt_z_ const char* psz); ~NoThrowString(); // Move constructor NoThrowString(NoThrowString&& str); // Copy constructor NoThrowString(const NoThrowString& str); // Assignment const NoThrowString& operator =(NoThrowString strSrc); const NoThrowString& operator =(const String& strSrc); const NoThrowString& operator =(wchar_t ch); const NoThrowString& operator =(char ch); const NoThrowString& operator =(_In_opt_z_ const wchar_t* psz); const NoThrowString& operator =(_In_opt_z_ const char* psz); const NoThrowString& operator =(_In_opt_z_ const unsigned char* psz); // Appending (For concatenation, see outside of the class definition below) const NoThrowString& operator +=(const NoThrowString& str); const NoThrowString& operator +=(wchar_t ch); const NoThrowString& operator +=(char ch); const NoThrowString& operator +=(_In_z_ const wchar_t* psz); // Conversion operator const wchar_t*() const; // Helper Methods const wchar_t* ToCStrWithFallbackTo(_In_z_ const wchar_t* pszDefaultString) const; /// Append a specified string to an existing NoThrowString NoThrowString& Append(const NoThrowString& strSrc); /// Append a specified string to an existing NoThrowString NoThrowString& Append(_In_z_ const wchar_t* pszSrc); /// Append a given character to this string NoThrowString& Append(wchar_t ch); /// Append a given character to this string NoThrowString& Append(char ch); /// Appends formatted data to an existing string NoThrowString& AppendFormat(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, ...); /// Appends formatted data to an existing string /// /// NoThrowString& AppendFormatV(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, va_list args); /// Compares two strings (case sensitive) int Compare(_In_z_ const wchar_t* pszCompare) const; /// Compares two strings (case insensitive). int CompareNoCase(_In_z_ const wchar_t* pszCompare) const; /// Copies the requested number of characters from the specified wchar_t*. Allocates more space if necessary. void Copy(_In_reads_or_z_(count) const wchar_t* pszSrc, int count); /// Deletes a character or characters from a string int Delete(int index, int count = 1); /// Empties the string void Empty(); /// Searches the string for the first match of the specified character int Find(wchar_t ch) const; /// Searches the string for the first match of the specified character int Find(wchar_t ch, int start) const; /// Searches the string for the first match of the specified substring int Find(_In_z_ const wchar_t* pszSub) const; /// Searches the string for the first match of the specified substring int Find(_In_z_ const wchar_t* pszSub, int start) const; /// Formats the string as swprintf does NoThrowString& Format(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, ...); /// Formats the string as swprintf does /// /// NoThrowString& FormatV(_In_z_ _Printf_format_string_ const wchar_t* pszFormat, va_list args); /// Frees any extra memory previously allocated by the string but no longer needed void FreeExtra(); /// Returns the count of characters in the string int GetLength() const; /// Inserts a single character at the given index within the string int Insert(int index, wchar_t ch); /// Inserts a substring at the given index within the string int Insert(int index, _In_z_ const wchar_t* psz); /// Returns whether or not the string is empty bool IsEmpty() const; /// Returns a non-const pointer to the underlying string buffer. If you write to the buffer using this pointer, be sure to call ReleaseBuffer when finished. unsigned short* GetBuffer(); /// Returns a pointer to the internal character buffer for the NoThrowString object, truncating or growing its length if necessary to exactly match the length specified in Length _Ret_writes_maybenull_(length + 1) unsigned short* GetBufferSetLength(int length); /// Call this method to reallocate or free up the buffer of the string object, If you know that the string in the buffer is null terminated, you can omit the newLength argument. If your string is not null terminated, use newLength to specify its length. NOTE: The address returned by GetBuffer is invalid after the call to ReleaseBuffer void ReleaseBuffer(int newLength = -1); /// Extracts the first (leftmost) count characters from the string NoThrowString Left(int count) const; /// Extracts a substring of length count characters, starting at position first NoThrowString Mid(int first, int count) const; /// Extracts a substring of length count characters, starting at position first NoThrowString Mid(int first) const; /// Removes instances of the specified character from the string int Remove(wchar_t removeChar); /// Replaces all instances of one character with another int Replace(wchar_t oldChar, wchar_t newChar); /// Replaces all instances of one substring with another int Replace(_In_z_ const wchar_t* pszOld, _In_z_ const wchar_t* pszNew); /// Reverses the order of characters in the string void Reverse(); /// Searches for a character inside a larger string; starts at the end of the string int ReverseFind(wchar_t ch) const; /// Extracts the last (rightmost) count characters from the string NoThrowString Right(int count) const; /// Converts all the characters in this string to lower-case NoThrowString& ToLower(); /// Converts all the characters in this string to upper-case NoThrowString& ToUpper(); /// Trims all leading and trailing whitespace, new line, tab and space characters from the string void Trim(); /// Trims all leading and trailing whitespace, new line, tab and space characters from the left portion of the string void TrimLeft(); /// Trims all leading and trailing whitespace, new line, tab and space characters from the right portion of the string void TrimRight(); /// Returns whether or not the string contents are still valid. This method should be called after any non-const NoThrowString member functions are called in order to check for validity of string contents. bool IsValid() const; /// Returns the last error encountered by the NoThrowString class HRESULT GetLastHResult() const; // Returns whether or not the specified const wchar_t* is null or an empty string static bool WEXCOMMON_STDCALL IsNullOrEmpty(const wchar_t* psz) { return !psz || !*psz || *psz == L'\0'; } // unsigned short exports #if defined(WEXCOMMON_FULL_BUILD) operator const unsigned short*() const; NoThrowString(_In_opt_z_ unsigned short* psz); NoThrowString(_In_reads_or_z_opt_(count) const unsigned short* psz, int count); // Constructs a String object, and copies the requested number of characters from the specified wchar_t* NoThrowString(_In_opt_z_ const unsigned short* psz); const NoThrowString& operator =(unsigned short ch); const NoThrowString& operator =(_In_opt_z_ const unsigned short* psz); const NoThrowString& operator +=(unsigned short ch); const NoThrowString& operator +=(_In_z_ const unsigned short* psz); const unsigned short* ToCStrWithFallbackTo(_In_z_ const unsigned short* pszDefaultString) const; NoThrowString& Append(_In_z_ const unsigned short* pszSrc); NoThrowString& Append(unsigned short ch); NoThrowString& AppendFormat(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, ...); NoThrowString& AppendFormatV(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, va_list args); int Compare(_In_z_ const unsigned short* pszCompare) const; int CompareNoCase(_In_z_ const unsigned short* pszCompare) const; void Copy(_In_reads_or_z_(count) const unsigned short* pszSrc, int count); int Find(unsigned short ch) const; int Find(unsigned short ch, int start) const; int Find(_In_z_ const unsigned short* pszSub) const; int Find(_In_z_ const unsigned short* pszSub, int start) const; NoThrowString& Format(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, ...); NoThrowString& FormatV(_In_z_ _Printf_format_string_ const unsigned short* pszFormat, va_list args); int Insert(int index, unsigned short ch); int Insert(int index, _In_z_ const unsigned short* psz); int Remove(unsigned short removeChar); int Replace(unsigned short oldChar, unsigned short newChar); int Replace(_In_z_ const unsigned short* pszOld, _In_z_ const unsigned short* pszNew); int ReverseFind(unsigned short ch) const; static bool WEXCOMMON_STDCALL IsNullOrEmpty(const unsigned short* psz) { return IsNullOrEmpty(reinterpret_cast(psz)); } #endif // WEXCOMMON_FULL_BUILD private: explicit NoThrowString(HRESULT hr); friend WEXCOMMON_API int WEXCOMMON_STDCALL GetBufferLength(const NoThrowString& string); friend WEXCOMMON_API void WEXCOMMON_STDCALL swap(NoThrowString& str1, NoThrowString& str2); // m_pReserved is not currently used. It exists to ensure the class has the size expected by code built against older TAEF headers. void* m_pReserved; HRESULT m_lastHr; wchar_t* m_psz; }; WEXCOMMON_API int WEXCOMMON_STDCALL GetBufferLength(const NoThrowString& string); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(const NoThrowString& str1, const NoThrowString& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(const NoThrowString& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(_In_z_ const wchar_t* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(const NoThrowString& str1, const NoThrowString& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(const NoThrowString& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(_In_z_ const wchar_t* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(const NoThrowString& str1, const NoThrowString& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(const NoThrowString& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(_In_z_ const wchar_t* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(const NoThrowString& str1, const NoThrowString& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(const NoThrowString& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(_In_z_ const wchar_t* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(const NoThrowString& str1, const NoThrowString& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(const NoThrowString& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(_In_z_ const wchar_t* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(const NoThrowString& str1, const NoThrowString& str2); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(const NoThrowString& str, _In_z_ const wchar_t* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(_In_z_ const wchar_t* psz, const NoThrowString& str); // Concatenation /// /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(NoThrowString str1, const NoThrowString& str2); /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(NoThrowString str, wchar_t ch); /// /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(wchar_t ch, const NoThrowString& str); /// /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(NoThrowString str, char ch); /// /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(char ch, const NoThrowString& str); /// /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(NoThrowString str, _In_z_ const wchar_t* lpsz); /// /// /// WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(_In_z_ const wchar_t* psz, const NoThrowString& str); // unsigned short exports #if defined(WEXCOMMON_FULL_BUILD) WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(const NoThrowString& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator==(_In_z_ const unsigned short* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(const NoThrowString& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator!=(_In_z_ const unsigned short* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(const NoThrowString& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<(_In_z_ const unsigned short* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(const NoThrowString& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>(_In_z_ const unsigned short* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(const NoThrowString& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator<=(_In_z_ const unsigned short* psz, const NoThrowString& str); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(const NoThrowString& str, _In_z_ const unsigned short* psz); WEXCOMMON_API bool WEXCOMMON_STDCALL operator>=(_In_z_ const unsigned short* psz, const NoThrowString& str); WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(NoThrowString str, unsigned short ch); WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(unsigned short ch, const NoThrowString& str); WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(NoThrowString str, _In_z_ const unsigned short* lpsz); WEXCOMMON_API NoThrowString WEXCOMMON_STDCALL operator+(_In_z_ const unsigned short* psz, const NoThrowString& str); #endif WEXCOMMON_API void WEXCOMMON_STDCALL swap(NoThrowString& str1, NoThrowString& str2); } /* namespace Common */ } /* namespace WEX */ #endif // #if !defined(__WEXSTRING_H__) && defined(_WIN32)