Subversion Repositories spk

Rev

Rev 191 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
// stdafx.h : include file for standard system include files,
2
// or project specific include files that are used frequently, but
3
// are changed infrequently
4
#pragma once
5
 
6
#include <CyString.h>
191 cycrow 7
#include <Utils/WString.h>
1 cycrow 8
#include "../../common/InputBox.h"
9
 
10
using namespace System;
11
using namespace System::Runtime::InteropServices;
12
 
242 cycrow 13
 
1 cycrow 14
inline CyString CyStringFromSystemString( System::String ^str)
15
{
16
	if ( !str || !str->Length )
17
		return NullString;
18
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
19
	std::string s = chars;
20
	Marshal::FreeHGlobal(IntPtr((void*)chars));
21
	return CyString(s);
22
}
23
 
24
inline System::String ^SystemStringFromCyString ( CyString str )
25
{
26
	System::String ^Str = gcnew System::String(str.c_str());
27
	return Str;
28
}
191 cycrow 29
 
30
inline System::String^ _US(const Utils::WString& str)
31
{
32
	System::String^ Str = gcnew System::String(str.c_str());
33
	return Str;
34
}
242 cycrow 35
 
36
inline Utils::WString _WS(System::String^ str)
37
{
38
	if (!str || !str->Length)
39
		return L"";
40
	const wchar_t* chars = (const wchar_t*)(Marshal::StringToHGlobalUni(str)).ToPointer();
41
	std::wstring s = chars;
42
	Marshal::FreeHGlobal(IntPtr((void*)chars));
43
	return s;
44
}