![]() |
MAK RTIspy API Documentation for HLA Evolved
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2010 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 00006 #ifndef stringUtil_H_ 00007 #define stringUtil_H_ 00008 00009 #include <string> 00010 #include <sstream> 00011 00012 // Convert narrow C string to wide string 00013 inline std::wstring DtToWString(const char * in_val) 00014 { 00015 std::wstring temp; 00016 while (*in_val != '\0') 00017 temp += *in_val++; 00018 return temp; 00019 } 00020 00021 // Convert narrow string to wide string 00022 inline std::string DtToString(const std::wstring &in_val) 00023 { 00024 std::string temp; 00025 std::wstring::const_iterator b = in_val.begin(); 00026 const std::wstring::const_iterator e = in_val.end(); 00027 while (b != e) 00028 { 00029 temp += static_cast<char>(*b); 00030 ++b; 00031 } 00032 return temp; 00033 } 00034 00035 #endif 00036