mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-22 07:04:56 -04:00
Feature/script type enhancement (#55)
This commit is contained in:
parent
321d0f0768
commit
9fe1849e72
10 changed files with 1243 additions and 635 deletions
|
@ -62,4 +62,22 @@ public:
|
|||
buffer[sizeof buffer - 1] = '\0';
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static inline std::vector<CString> Split(CString str, char ch = ',') {
|
||||
std::vector<CString> ret;
|
||||
int start = 0;
|
||||
int end = 0;
|
||||
|
||||
while (end != -1) {
|
||||
end = str.Find(ch, start);
|
||||
if (end == -1) {
|
||||
ret.push_back(str.Mid(start));
|
||||
} else {
|
||||
ret.push_back(str.Mid(start, end - start));
|
||||
start = end + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue