(file) Return to strutil.h CVS log (file) (dir) Up to [OMI] / omi / ut

 1 mike  1.1 /*
 2           **==============================================================================
 3           **
 4           ** Open Management Infrastructure (OMI)
 5           **
 6           ** Copyright (c) Microsoft Corporation
 7           ** 
 8           ** Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 9           ** use this file except in compliance with the License. You may obtain a copy 
10           ** of the License at 
11           **
12           **     http://www.apache.org/licenses/LICENSE-2.0 
13           **
14           ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15           ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
16           ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
17           ** MERCHANTABLITY OR NON-INFRINGEMENT. 
18           **
19           ** See the Apache 2 License for the specific language governing permissions 
20           ** and limitations under the License.
21           **
22 mike  1.1 **==============================================================================
23           */
24           
25           //==============================================================================
26           //
27           // strutil.h : provides helper macro/classes for statik string wrappers
28           //
29           //==============================================================================
30           
31           #ifndef _strutil_h
32           #define _strutil_h
33           
34           #include <string>
35           #include <vector>
36           #include <MI.h>
37           
38           namespace ut
39           {
40           #if (MI_CHAR_TYPE == 1)
41               typedef std::string String;
42           #else
43 mike  1.1     typedef std::wstring String;
44           #endif
45           
46 krisbash 1.3     // primitive converion of ZChar to char - mostly for debugging printouts
47 mike     1.1     std::string StrToChar(const String& str);
48              
49                  // array <--> string converions like "A,B,C" <-> ["A","B","C"]
50                  void StringToArray(
51 krisbash 1.3         const ZChar* str, 
52 mike     1.1         std::vector<String>& res, 
53 krisbash 1.3         ZChar delim = ',');
54 mike     1.1 
55                  String ArrayToString(
56                      const std::vector<String>& ar);
57              };
58              
59              #endif /* _strutil_h */

ViewCVS 0.9.2