Dual CANbus monitor and instrumentation cluster
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed
Fork of CANary by
Util/stringUtils.h@125:f58b7ab2abee, 2013-07-21 (annotated)
- Committer:
- TickTock
- Date:
- Sun Jul 21 11:08:38 2013 +0000
- Branch:
- Metric
- Revision:
- 125:f58b7ab2abee
- Parent:
- 1:9dcd70c32180
Re-centered efficiency screen
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TickTock | 1:9dcd70c32180 | 1 | /* |
TickTock | 1:9dcd70c32180 | 2 | Copyright (c) 2011 Robert Ellis (holistic [at] robellis [dot] org [dot] uk) |
TickTock | 1:9dcd70c32180 | 3 | |
TickTock | 1:9dcd70c32180 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy |
TickTock | 1:9dcd70c32180 | 5 | of this software and associated documentation files (the "Software"), to deal |
TickTock | 1:9dcd70c32180 | 6 | in the Software without restriction, including without limitation the rights |
TickTock | 1:9dcd70c32180 | 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
TickTock | 1:9dcd70c32180 | 8 | copies of the Software, and to permit persons to whom the Software is |
TickTock | 1:9dcd70c32180 | 9 | furnished to do so, subject to the following conditions: |
TickTock | 1:9dcd70c32180 | 10 | |
TickTock | 1:9dcd70c32180 | 11 | The above copyright notice and this permission notice shall be included in |
TickTock | 1:9dcd70c32180 | 12 | all copies or substantial portions of the Software. |
TickTock | 1:9dcd70c32180 | 13 | |
TickTock | 1:9dcd70c32180 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
TickTock | 1:9dcd70c32180 | 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
TickTock | 1:9dcd70c32180 | 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
TickTock | 1:9dcd70c32180 | 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
TickTock | 1:9dcd70c32180 | 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
TickTock | 1:9dcd70c32180 | 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
TickTock | 1:9dcd70c32180 | 20 | THE SOFTWARE. |
TickTock | 1:9dcd70c32180 | 21 | */ |
TickTock | 1:9dcd70c32180 | 22 | |
TickTock | 1:9dcd70c32180 | 23 | #ifndef STRING_UTILS_H |
TickTock | 1:9dcd70c32180 | 24 | #define STRING_UTILS_H |
TickTock | 1:9dcd70c32180 | 25 | |
TickTock | 1:9dcd70c32180 | 26 | #include <string> |
TickTock | 1:9dcd70c32180 | 27 | #include <vector> |
TickTock | 1:9dcd70c32180 | 28 | using namespace std; |
TickTock | 1:9dcd70c32180 | 29 | |
TickTock | 1:9dcd70c32180 | 30 | /** |
TickTock | 1:9dcd70c32180 | 31 | * Trims whitespace characters from beginning and end of given string. |
TickTock | 1:9dcd70c32180 | 32 | */ |
TickTock | 1:9dcd70c32180 | 33 | string trim(const string& src, const string& c = " \r\n"); |
TickTock | 1:9dcd70c32180 | 34 | |
TickTock | 1:9dcd70c32180 | 35 | /** |
TickTock | 1:9dcd70c32180 | 36 | * Tokenize given string delimmted by given delimter into a vector of seprate strings. |
TickTock | 1:9dcd70c32180 | 37 | */ |
TickTock | 1:9dcd70c32180 | 38 | vector<string> tokenize(const string& str, const string& delimiters = " "); |
TickTock | 1:9dcd70c32180 | 39 | |
TickTock | 1:9dcd70c32180 | 40 | #endif |