(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           # define T(X) X
42               typedef std::string String;
43 mike  1.1 #else
44           # define T(X) L##X
45               typedef std::wstring String;
46           #endif
47           
48               // primitive converion of MI_Char to char - mostly for debugging printouts
49               std::string StrToChar(const String& str);
50           
51               // array <--> string converions like "A,B,C" <-> ["A","B","C"]
52               void StringToArray(
53                   const MI_Char* str, 
54                   std::vector<String>& res, 
55                   MI_Char delim = ',');
56           
57               String ArrayToString(
58                   const std::vector<String>& ar);
59           };
60           
61           #endif /* _strutil_h */

ViewCVS 0.9.2