FzApiStructures.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // FileZilla - a Windows ftp client
  2. // Copyright (C) 2002-2004 - Tim Kosse <[email protected]>
  3. // This program is free software; you can redistribute it and/or
  4. // modify it under the terms of the GNU General Public License
  5. // as published by the Free Software Foundation; either version 2
  6. // of the License, or (at your option) any later version.
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU General Public License for more details.
  11. // You should have received a copy of the GNU General Public License
  12. // along with this program; if not, write to the Free Software
  13. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. #include "stdafx.h"
  15. #include "FzApiStructures.h"
  16. t_server::t_server()
  17. {
  18. nPasv = 0;
  19. nTimeZoneOffset = 0;
  20. nUTF8 = 0;
  21. }
  22. t_server::~t_server()
  23. {
  24. }
  25. const bool operator == (const t_server &a,const t_server &b)
  26. {
  27. if (a.host!=b.host)
  28. return false;
  29. if (a.port!=b.port)
  30. return false;
  31. if (a.user!=b.user)
  32. return false;
  33. if (a.account != b.account)
  34. return false;
  35. if (a.pass!=b.pass && a.user!="anonymous")
  36. return false;
  37. if (a.nServerType!=b.nServerType)
  38. return false;
  39. if (a.nPasv != b.nPasv)
  40. return false;
  41. if (a.nTimeZoneOffset != b.nTimeZoneOffset)
  42. return false;
  43. if (a.nUTF8 != b.nUTF8)
  44. return false;
  45. return true;
  46. }
  47. const bool operator != (const t_server &a,const t_server &b)
  48. {
  49. return !(a == b);
  50. }
  51. bool t_server::operator<(const t_server &op) const
  52. {
  53. if (host<op.host)
  54. return true;
  55. if (port<op.port)
  56. return true;
  57. if (user<op.user)
  58. return true;
  59. if (account<op.account)
  60. return true;
  61. if (pass<op.pass)
  62. return true;
  63. if (nServerType<op.nServerType)
  64. return true;
  65. if (nPasv < op.nPasv)
  66. return true;
  67. if (nTimeZoneOffset < op.nTimeZoneOffset)
  68. return true;
  69. if (nUTF8 < op.nUTF8)
  70. return true;
  71. return false;
  72. }