source: trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h @ 63

Last change on this file since 63 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
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
14using namespace std;
15
16namespace morpheo              {
17 
18  inline 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  inline 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.