Last change
on this file since 84 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
670 bytes
|
Rev | Line | |
---|
[38] | 1 | #ifndef morpheo_changecase |
---|
| 2 | #define morpheo_changecase |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: ChangeCase.h 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <string> |
---|
| 12 | #include <stdint.h> |
---|
| 13 | |
---|
| 14 | namespace morpheo { |
---|
| 15 | |
---|
[71] | 16 | inline void UpperCase(std::string& S) |
---|
[38] | 17 | { |
---|
| 18 | uint32_t n = S.size(); |
---|
| 19 | for (uint32_t j = 0; j < n; j++) |
---|
| 20 | { |
---|
| 21 | char sj = S[j]; |
---|
| 22 | if (sj >= 'a' && sj <= 'z') |
---|
| 23 | S[j] = static_cast<char>(sj - ('a' - 'A')); |
---|
| 24 | } |
---|
| 25 | } |
---|
| 26 | |
---|
[71] | 27 | inline void LowerCase(std::string& S) |
---|
[38] | 28 | { |
---|
| 29 | uint32_t n = S.size(); |
---|
| 30 | for (uint32_t j = 0; j < n; j++) |
---|
| 31 | { |
---|
| 32 | char sj = S[j]; |
---|
| 33 | if (sj >= 'A' && sj <= 'Z') |
---|
| 34 | S[j] = static_cast<char>(sj + ('a' - 'A')); |
---|
| 35 | } |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | }; // end namespace morpheo |
---|
| 39 | |
---|
| 40 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.