Last change
on this file since 50 was
43,
checked in by rosiere, 17 years ago
|
Modif mineur : ajout d'info de débug
Release non stable
|
File size:
668 bytes
|
Line | |
---|
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 | |
---|
18 | void UpperCase(string& S) |
---|
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 | |
---|
29 | void LowerCase(string& S) |
---|
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.