MCPcopy Create free account
hub / github.com/GPUOpen-Tools/radeon_gpu_analyzer / Split

Method Split

external/amdt_base_tools/src/gtASCIIString.cpp:1841–1874  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Name: Split Description: Split the string up into a list using rSep as the delimiter (separator) Return Val: std::list of substrings Author: AMD Developer Tools Team Date: 28/6/2013 ---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1839// Date: 28/6/2013
1840// ---------------------------------------------------------------------------
1841void gtASCIIString::Split(const gtASCIIString& rSep, bool bCaseSensitive, std::list<gtASCIIString>& outList) const
1842{
1843 (void)(bCaseSensitive); // unused
1844
1845 unsigned int nSepLen = rSep.length();
1846 int nPos = 0;
1847 int nPrevPos = 0;
1848 bool bDone = false;
1849
1850 while (!bDone)
1851 {
1852 nPrevPos = nPos;
1853 nPos = find(rSep, nPos);
1854
1855 if (nPos == -1)
1856 {
1857 // no more occurences of separator found, append last substring and return
1858 nPos = length();
1859 bDone = true;
1860 }
1861
1862 // append substring to list
1863 gtASCIIString subStr;
1864
1865 if (nPos > nPrevPos)
1866 {
1867 const char* startPtr = &_impl.c_str()[nPrevPos];
1868 subStr.append(startPtr, nPos - nPrevPos);
1869 }
1870
1871 outList.push_back(subStr);
1872 nPos += nSepLen; // skip past the separator string
1873 }
1874}
1875
1876// ---------------------------------------------------------------------------
1877// Name: find_first_not_of

Callers 1

buttonLaunchClickMethod · 0.80

Calls 3

appendMethod · 0.80
lengthMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected