--------------------------------------------------------------------------- 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 ---------------------------------------------------------------------------
| 1839 | // Date: 28/6/2013 |
| 1840 | // --------------------------------------------------------------------------- |
| 1841 | void 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 |
no test coverage detected