mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Добавлена функция Split для страндартных стрингов std::wstring.
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62607 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
c9c9ed4f90
commit
3c609fbe83
@ -2,6 +2,8 @@
|
||||
#define _BUILD_STRING_CROSSPLATFORM_H_
|
||||
|
||||
#include "CPEncodings/CodePage.h"
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
namespace NSString
|
||||
{
|
||||
@ -178,6 +180,23 @@ namespace NSString
|
||||
return sRet;
|
||||
}
|
||||
};
|
||||
|
||||
static std::vector<std::wstring>& Split(const std::wstring& wsString, wchar_t nDelim, std::vector<std::wstring> &arrElements)
|
||||
{
|
||||
std::wstringstream wStringStream(wsString);
|
||||
std::wstring wsItem;
|
||||
while (std::getline(wStringStream, wsItem, nDelim))
|
||||
{
|
||||
arrElements.push_back(wsItem);
|
||||
}
|
||||
return arrElements;
|
||||
}
|
||||
static std::vector<std::wstring> Split(const std::wstring& wsString, wchar_t nDelim)
|
||||
{
|
||||
std::vector<std::wstring> wsElements;
|
||||
Split(wsString, nDelim, wsElements);
|
||||
return wsElements;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _BUILD_STRING_CROSSPLATFORM_H_
|
||||
|
||||
Reference in New Issue
Block a user