Last change
on this file since 7187 was
6648,
checked in by bensch, 19 years ago
|
orxonox/trunk: built two new functions for the NETWORK precache
fromResourceableStrin and toResourceableString
these two functions can be used to CACHE a Resource loaded on one Machine on the other one
|
File size:
1.0 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file substring.h |
---|
3 | \brief a small class to get the parts of a string separated by commas |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _SUBSTRING_H |
---|
7 | #define _SUBSTRING_H |
---|
8 | |
---|
9 | //! A class that can load one string and split it in multipe ones |
---|
10 | class SubString |
---|
11 | { |
---|
12 | public: |
---|
13 | SubString(const char* string, char splitter = ','); |
---|
14 | SubString(const char* string, bool whiteSpaces); |
---|
15 | SubString(const char* string, const char* splitters, char escapeChar ='\\'); |
---|
16 | ~SubString(); |
---|
17 | |
---|
18 | const char* operator[](unsigned int i) { return this->getString(i); }; |
---|
19 | |
---|
20 | inline unsigned int getCount() { return this->splittersCount; }; |
---|
21 | const char* getString(unsigned int i); |
---|
22 | unsigned int getOffset(unsigned int i); |
---|
23 | |
---|
24 | void debug() const; |
---|
25 | |
---|
26 | private: |
---|
27 | char** strings; //!< strings produced from a single string splitted in multiple strings |
---|
28 | unsigned int* offsets; //!< offsets of the beginning of the input-string to the beginning of each substring. |
---|
29 | unsigned int splittersCount; //!< how many splitted parts |
---|
30 | }; |
---|
31 | |
---|
32 | #endif /* _SUBSTRING_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.