Last change
on this file since 135 was
88,
checked in by rosiere, 16 years ago
|
Almost complete design
with Test and test platform
|
-
Property svn:keywords set to
Id
|
File size:
674 bytes
|
Line | |
---|
1 | #ifndef Morpheo_ChangeCase_h |
---|
2 | #define Morpheo_ChangeCase_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: ChangeCase.h 88 2008-12-10 18:31:39Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #include <string> |
---|
12 | #include <stdint.h> |
---|
13 | |
---|
14 | namespace morpheo { |
---|
15 | |
---|
16 | inline void UpperCase(std::string& S) |
---|
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 | |
---|
27 | inline void LowerCase(std::string& S) |
---|
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.