Last change
on this file since 70 was
63,
checked in by rosiere, 17 years ago
|
par rapport au commit precedent : commit des include commun et un petit (vraiment petit) peu de doc
|
File size:
682 bytes
|
Rev | Line | |
---|
[38] | 1 | #ifndef morpheo_changecase |
---|
| 2 | #define morpheo_changecase |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <string> |
---|
| 12 | #include <stdint.h> |
---|
| 13 | |
---|
| 14 | using namespace std; |
---|
| 15 | |
---|
| 16 | namespace morpheo { |
---|
| 17 | |
---|
[63] | 18 | inline void UpperCase(string& S) |
---|
[38] | 19 | { |
---|
| 20 | uint32_t n = S.size(); |
---|
| 21 | for (uint32_t j = 0; j < n; j++) |
---|
| 22 | { |
---|
| 23 | char sj = S[j]; |
---|
| 24 | if (sj >= 'a' && sj <= 'z') |
---|
| 25 | S[j] = static_cast<char>(sj - ('a' - 'A')); |
---|
| 26 | } |
---|
| 27 | } |
---|
| 28 | |
---|
[63] | 29 | inline void LowerCase(string& S) |
---|
[38] | 30 | { |
---|
| 31 | uint32_t n = S.size(); |
---|
| 32 | for (uint32_t j = 0; j < n; j++) |
---|
| 33 | { |
---|
| 34 | char sj = S[j]; |
---|
| 35 | if (sj >= 'A' && sj <= 'Z') |
---|
| 36 | S[j] = static_cast<char>(sj + ('a' - 'A')); |
---|
| 37 | } |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | }; // end namespace morpheo |
---|
| 41 | |
---|
| 42 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.