Subversion Repositories spk

Rev

Rev 1 | Rev 121 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 39
Line 5... Line 5...
5
using namespace System::Drawing;
5
using namespace System::Drawing;
6
 
6
 
7
#define CONNECTERROR_UNKNOWN	-1
7
#define CONNECTERROR_UNKNOWN	-1
8
enum {CONNECTERROR_NONE, CONNECTERROR_TIMEOUT, CONNECTERROR_NOFILE, CONNECTERROR_FAILED};
8
enum {CONNECTERROR_NONE, CONNECTERROR_TIMEOUT, CONNECTERROR_NOFILE, CONNECTERROR_FAILED};
9
 
9
 
-
 
10
inline Utils::String _S(System::String ^str)
-
 
11
{
-
 
12
	if ( !str || !str->Length )
-
 
13
		return "";
-
 
14
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
-
 
15
	std::string s = chars;
-
 
16
	Marshal::FreeHGlobal(IntPtr((void*)chars));
-
 
17
	return s;
-
 
18
}
10
inline CyString CyStringFromSystemString( System::String ^str)
19
inline CyString CyStringFromSystemString( System::String ^str)
11
{
20
{
12
	if ( !str || !str->Length )
21
	if ( !str || !str->Length )
13
		return NullString;
22
		return NullString;
14
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
23
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
Line 52... Line 61...
52
					break;
61
					break;
53
				default:
62
				default:
54
					ret = CONNECTERROR_UNKNOWN;
63
					ret = CONNECTERROR_UNKNOWN;
55
			}
64
			}
56
		}
65
		}
57
	}
66
	}
58
 
67
 
59
	return ret;
68
	return ret;
60
}
69
}
61
 
70
 
62
inline String ^ReadDataFromWeb(String ^url)
71
inline String ^ReadDataFromWeb(String ^url)
63
{
72
{
Line 83... Line 92...
83
		return data;
92
		return data;
84
	return nullptr;
93
	return nullptr;
85
}
94
}
86
 
95
 
87
inline System::String ^SystemStringFromCyString ( CyString str )
96
inline System::String ^SystemStringFromCyString ( CyString str )
-
 
97
{
-
 
98
	System::String ^Str = gcnew System::String(str.c_str());
-
 
99
	return Str;
-
 
100
}
-
 
101
inline System::String ^_US(const Utils::String &str)
88
{
102
{
89
	System::String ^Str = gcnew System::String(str.c_str());
103
	System::String ^Str = gcnew System::String(str.c_str());
90
	return Str;
104
	return Str;
91
}
105
}
92
 
106