mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-05-01 09:31:40 -04:00
25 lines
410 B
C++
25 lines
410 B
C++
#pragma once
|
|
|
|
#include <afx.h>
|
|
#include <vector>
|
|
|
|
namespace utilities {
|
|
static std::vector<CString> split_string(const CString& pSource, TCHAR cSplit = ',')
|
|
{
|
|
std::vector<CString> ret;
|
|
CString tmp = pSource;
|
|
int pos = 0;
|
|
|
|
while ((pos = tmp.Find(cSplit)) != -1) {
|
|
ret.push_back(tmp.Left(pos));
|
|
tmp = tmp.Mid(pos + 1);
|
|
}
|
|
|
|
if (!tmp.IsEmpty()) {
|
|
ret.push_back(tmp);
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
}
|
|
|