mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:43:01 +00:00
[ATL] Overload const-return-versions of FindChar/FindString/FindOneOf (#5473)
Overload the const-return-versions of FindChar/FindCharReverse/FindString/FindOneOf. Modify CStringT::Replace.
This commit is contained in:
parent
2010a5b8d9
commit
985680068c
2 changed files with 53 additions and 1 deletions
|
@ -358,6 +358,10 @@ public:
|
||||||
return GetData()->nDataLength;
|
return GetData()->nDataLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PXSTR GetString() throw()
|
||||||
|
{
|
||||||
|
return m_pszData;
|
||||||
|
}
|
||||||
PCXSTR GetString() const throw()
|
PCXSTR GetString() const throw()
|
||||||
{
|
{
|
||||||
return m_pszData;
|
return m_pszData;
|
||||||
|
|
|
@ -99,6 +99,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPWSTR __cdecl FindString(
|
static LPWSTR __cdecl FindString(
|
||||||
|
_In_z_ LPWSTR pszSource,
|
||||||
|
_In_z_ LPCWSTR pszSub)
|
||||||
|
{
|
||||||
|
return ::wcsstr(pszSource, pszSub);
|
||||||
|
}
|
||||||
|
static LPCWSTR __cdecl FindString(
|
||||||
_In_z_ LPCWSTR pszSource,
|
_In_z_ LPCWSTR pszSource,
|
||||||
_In_z_ LPCWSTR pszSub)
|
_In_z_ LPCWSTR pszSub)
|
||||||
{
|
{
|
||||||
|
@ -106,6 +112,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPWSTR __cdecl FindChar(
|
static LPWSTR __cdecl FindChar(
|
||||||
|
_In_z_ LPWSTR pszSource,
|
||||||
|
_In_ WCHAR ch)
|
||||||
|
{
|
||||||
|
return ::wcschr(pszSource, ch);
|
||||||
|
}
|
||||||
|
static LPCWSTR __cdecl FindChar(
|
||||||
_In_z_ LPCWSTR pszSource,
|
_In_z_ LPCWSTR pszSource,
|
||||||
_In_ WCHAR ch)
|
_In_ WCHAR ch)
|
||||||
{
|
{
|
||||||
|
@ -113,6 +125,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPWSTR __cdecl FindCharReverse(
|
static LPWSTR __cdecl FindCharReverse(
|
||||||
|
_In_z_ LPWSTR pszSource,
|
||||||
|
_In_ WCHAR ch)
|
||||||
|
{
|
||||||
|
return ::wcsrchr(pszSource, ch);
|
||||||
|
}
|
||||||
|
static LPCWSTR __cdecl FindCharReverse(
|
||||||
_In_z_ LPCWSTR pszSource,
|
_In_z_ LPCWSTR pszSource,
|
||||||
_In_ WCHAR ch)
|
_In_ WCHAR ch)
|
||||||
{
|
{
|
||||||
|
@ -120,6 +138,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPWSTR __cdecl FindOneOf(
|
static LPWSTR __cdecl FindOneOf(
|
||||||
|
_In_z_ LPWSTR pszSource,
|
||||||
|
_In_z_ LPCWSTR pszCharSet)
|
||||||
|
{
|
||||||
|
return ::wcspbrk(pszSource, pszCharSet);
|
||||||
|
}
|
||||||
|
static LPCWSTR __cdecl FindOneOf(
|
||||||
_In_z_ LPCWSTR pszSource,
|
_In_z_ LPCWSTR pszSource,
|
||||||
_In_z_ LPCWSTR pszCharSet)
|
_In_z_ LPCWSTR pszCharSet)
|
||||||
{
|
{
|
||||||
|
@ -262,6 +286,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPSTR __cdecl FindString(
|
static LPSTR __cdecl FindString(
|
||||||
|
_In_z_ LPSTR pszSource,
|
||||||
|
_In_z_ LPCSTR pszSub)
|
||||||
|
{
|
||||||
|
return ::strstr(pszSource, pszSub);
|
||||||
|
}
|
||||||
|
static LPCSTR __cdecl FindString(
|
||||||
_In_z_ LPCSTR pszSource,
|
_In_z_ LPCSTR pszSource,
|
||||||
_In_z_ LPCSTR pszSub)
|
_In_z_ LPCSTR pszSub)
|
||||||
{
|
{
|
||||||
|
@ -269,6 +299,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPSTR __cdecl FindChar(
|
static LPSTR __cdecl FindChar(
|
||||||
|
_In_z_ LPSTR pszSource,
|
||||||
|
_In_ CHAR ch)
|
||||||
|
{
|
||||||
|
return ::strchr(pszSource, ch);
|
||||||
|
}
|
||||||
|
static LPCSTR __cdecl FindChar(
|
||||||
_In_z_ LPCSTR pszSource,
|
_In_z_ LPCSTR pszSource,
|
||||||
_In_ CHAR ch)
|
_In_ CHAR ch)
|
||||||
{
|
{
|
||||||
|
@ -276,6 +312,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPSTR __cdecl FindCharReverse(
|
static LPSTR __cdecl FindCharReverse(
|
||||||
|
_In_z_ LPSTR pszSource,
|
||||||
|
_In_ CHAR ch)
|
||||||
|
{
|
||||||
|
return ::strrchr(pszSource, ch);
|
||||||
|
}
|
||||||
|
static LPCSTR __cdecl FindCharReverse(
|
||||||
_In_z_ LPCSTR pszSource,
|
_In_z_ LPCSTR pszSource,
|
||||||
_In_ CHAR ch)
|
_In_ CHAR ch)
|
||||||
{
|
{
|
||||||
|
@ -283,6 +325,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPSTR __cdecl FindOneOf(
|
static LPSTR __cdecl FindOneOf(
|
||||||
|
_In_z_ LPSTR pszSource,
|
||||||
|
_In_z_ LPCSTR pszCharSet)
|
||||||
|
{
|
||||||
|
return ::strpbrk(pszSource, pszCharSet);
|
||||||
|
}
|
||||||
|
static LPCSTR __cdecl FindOneOf(
|
||||||
_In_z_ LPCSTR pszSource,
|
_In_z_ LPCSTR pszSource,
|
||||||
_In_z_ LPCSTR pszCharSet)
|
_In_z_ LPCSTR pszCharSet)
|
||||||
{
|
{
|
||||||
|
@ -876,7 +924,7 @@ public:
|
||||||
|
|
||||||
int Replace(XCHAR chOld, XCHAR chNew)
|
int Replace(XCHAR chOld, XCHAR chNew)
|
||||||
{
|
{
|
||||||
PCXSTR pszString = CThisSimpleString::GetString();
|
PXSTR pszString = CThisSimpleString::GetString();
|
||||||
PXSTR pszFirst = StringTraits::FindChar(pszString, chOld);
|
PXSTR pszFirst = StringTraits::FindChar(pszString, chOld);
|
||||||
if (!pszFirst)
|
if (!pszFirst)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue