Changeset 4734 in orxonox.OLD for orxonox/trunk/src/lib/util
- Timestamp:
- Jun 29, 2005, 3:05:47 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/substring.cc
r4597 r4734 27 27 #include <assert.h> 28 28 29 SubString::SubString( const char* string )29 SubString::SubString( const char* string, char splitter) 30 30 { 31 31 n = 0; … … 33 33 assert( string != NULL); 34 34 35 for( int i = 0; i < strlen(string); i++) if( string[i] == ',') n++;35 for( int i = 0; i < strlen(string); i++) if( string[i] == splitter) n++; 36 36 37 37 n += 1; … … 45 45 46 46 const char* offset = string; 47 char* end = strchr( string, ',');47 char* end = strchr( string, splitter); 48 48 while( end != NULL) 49 49 { … … 57 57 end++; 58 58 offset = end; 59 end = strchr( offset, ',');59 end = strchr( offset, splitter); 60 60 } 61 61 -
orxonox/trunk/src/lib/util/substring.h
r4597 r4734 11 11 { 12 12 public: 13 SubString(const char* string );13 SubString(const char* string, char splitter = ','); 14 14 ~SubString(); 15 15
Note: See TracChangeset
for help on using the changeset viewer.