#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol)
-IMPLEMENT_PROTOCOL(wxFTP, T("ftp"), T("ftp"), TRUE)
+IMPLEMENT_PROTOCOL(wxFTP, wxT("ftp"), wxT("ftp"), TRUE)
#endif
////////////////////////////////////////////////////////////////
m_lastError = wxPROTO_NOERR;
m_streaming = FALSE;
- m_user = T("anonymous");
+ m_user = wxT("anonymous");
m_passwd = wxGetUserId();
m_passwd += '@';
m_passwd += wxGetHostName();
wxFTP::~wxFTP()
{
- SendCommand("QUIT(", '2');
+ SendCommand("QUIT", '2');
}
////////////////////////////////////////////////////////////////
return FALSE;
}
- command.sprintf(T("USER %s"), (const wxChar *)m_user);
+ command.sprintf(wxT("USER %s"), (const wxChar *)m_user);
if (!SendCommand(command, '3')) {
Close();
return FALSE;
}
- command.sprintf(T("PASS %s"), (const wxChar *)m_passwd);
+ command.sprintf(wxT("PASS %s"), (const wxChar *)m_passwd);
if (!SendCommand(command, '2')) {
Close();
return FALSE;
wxString my_host = host;
addr.Hostname(my_host);
- addr.Service(T("ftp"));
+ addr.Service(wxT("ftp"));
return Connect(addr);
}
return FALSE;
}
if (m_connected)
- SendCommand(wxString(T("QUIT(")), '2');
+ SendCommand(wxString(wxT("QUIT")), '2');
return wxSocketClient::Close();
}
m_lastError = wxPROTO_STREAMING;
return FALSE;
}
- tmp_str = command + T("\r\n");
+ tmp_str = command + wxT("\r\n");
const wxWX2MBbuf tmp_buf = tmp_str.mb_str();
if (Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) {
m_lastError = wxPROTO_NETERR;
if (m_lastResult.GetChar(3) == '-') {
wxString key = m_lastResult.Left((size_t)3);
- key += T(' ');
+ key += wxT(' ');
while (m_lastResult.Index(key) != 0) {
m_lastError = GetLine(this, m_lastResult);
{
wxString str = dir;
- str.Prepend(T("CWD "));
+ str.Prepend(wxT("CWD "));
return SendCommand(str, '2');
}
bool wxFTP::MkDir(const wxString& dir)
{
wxString str = dir;
- str.Prepend(T("MKD "));
+ str.Prepend(wxT("MKD "));
return SendCommand(str, '2');
}
{
wxString str = dir;
- str.Prepend(T("PWD "));
+ str.Prepend(wxT("PWD "));
return SendCommand(str, '2');
}
{
int beg, end;
- if (!SendCommand(T("PWD"), '2'))
+ if (!SendCommand(wxT("PWD"), '2'))
return wxString((char *)NULL);
- beg = m_lastResult.Find(T('\"'),FALSE);
- end = m_lastResult.Find(T('\"'),TRUE);
+ beg = m_lastResult.Find(wxT('\"'),FALSE);
+ end = m_lastResult.Find(wxT('\"'),TRUE);
return wxString(beg+1, end);
}
{
wxString str;
- str = T("RNFR ") + src;
+ str = wxT("RNFR ") + src;
if (!SendCommand(str, '3'))
return FALSE;
- str = T("RNTO ") + dst;
+ str = wxT("RNTO ") + dst;
return SendCommand(str, '2');
}
{
wxString str;
- str = T("DELE ");
+ str = wxT("DELE ");
str += path;
return SendCommand(str, '2');
}
wxUint16 port;
wxUint32 hostaddr;
- if (!SendCommand(T("PASV"), '2'))
+ if (!SendCommand(wxT("PASV"), '2'))
return NULL;
- addr_pos = m_lastResult.Find(T('('));
+ addr_pos = m_lastResult.Find(wxT('('));
if (addr_pos == -1) {
m_lastError = wxPROTO_PROTERR;
return NULL;
}
straddr = m_lastResult(addr_pos+1, m_lastResult.Length());
- wxSscanf((const wxChar *)straddr,T("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
+ wxSscanf((const wxChar *)straddr,wxT("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
hostaddr = (wxUint16)a[5] << 24 | (wxUint16)a[4] << 16 |
(wxUint16)a[3] << 8 | a[2];
bool wxFTP::Abort(void)
{
m_streaming = FALSE;
- if (!SendCommand(T("ABOR"), '4'))
+ if (!SendCommand(wxT("ABOR"), '4'))
return FALSE;
return GetResult('2');
}
int pos_size;
wxInputFTPStream *in_stream;
- if (!SendCommand(T("TYPE I"), '2'))
+ if (!SendCommand(wxT("TYPE I"), '2'))
return NULL;
wxSocketClient *sock = GetPort();
return NULL;
}
- tmp_str = T("RETR ") + wxURL::ConvertFromURI(path);
+ tmp_str = wxT("RETR ") + wxURL::ConvertFromURI(path);
if (!SendCommand(tmp_str, '1'))
return NULL;
in_stream = new wxInputFTPStream(this, sock);
- pos_size = m_lastResult.Index(T('('));
+ pos_size = m_lastResult.Index(wxT('('));
if (pos_size != wxNOT_FOUND) {
- wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(T(')'))-1);
+ wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(wxT(')'))-1);
in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size);
}
{
wxString tmp_str;
- if (!SendCommand(T("TYPE I"), '2'))
+ if (!SendCommand(wxT("TYPE I"), '2'))
return NULL;
wxSocketClient *sock = GetPort();
- tmp_str = T("STOR ") + path;
+ tmp_str = wxT("STOR ") + path;
if (!SendCommand(tmp_str, '1'))
return FALSE;
{
wxList *file_list = new wxList;
wxSocketBase *sock = GetPort();
- wxString tmp_str = T("NLST(");
+ wxString tmp_str = wxT("NLST");
if (!wildcard.IsNull())
tmp_str += wildcard;