Function to return the number of columns in 'string' given delimeters in 'set'
| 33 | |
| 34 | // Function to return the number of columns in 'string' given delimeters in 'set' |
| 35 | static U32 getColumnCount(const char *string, const char *set) |
| 36 | { |
| 37 | U32 count = 0; |
| 38 | U8 last = 0; |
| 39 | while(*string) |
| 40 | { |
| 41 | last = *string++; |
| 42 | |
| 43 | for(U32 i =0; set[i]; i++) |
| 44 | { |
| 45 | if(last == set[i]) |
| 46 | { |
| 47 | count++; |
| 48 | last = 0; |
| 49 | break; |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | if(last) |
| 54 | count++; |
| 55 | return count; |
| 56 | } |
| 57 | |
| 58 | // Function to return the 'index' column from 'string' given delimeters in 'set' |
| 59 | static const char *getColumn(const char *string, char* returnbuff, U32 index, const char *set) |
no outgoing calls
no test coverage detected