FzApiStructures.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. #ifdef MPEXT
  46. if (a.iForcePasvIp != b.iForcePasvIp)
  47. return false;
  48. #endif
  49. return true;
  50. }
  51. const bool operator != (const t_server &a,const t_server &b)
  52. {
  53. return !(a == b);
  54. }
  55. bool t_server::operator<(const t_server &op) const
  56. {
  57. if (host<op.host)
  58. return true;
  59. if (port<op.port)
  60. return true;
  61. if (user<op.user)
  62. return true;
  63. if (account<op.account)
  64. return true;
  65. if (pass<op.pass)
  66. return true;
  67. if (nServerType<op.nServerType)
  68. return true;
  69. if (nPasv < op.nPasv)
  70. return true;
  71. if (nTimeZoneOffset < op.nTimeZoneOffset)
  72. return true;
  73. if (nUTF8 < op.nUTF8)
  74. return true;
  75. #ifdef MPEXT
  76. if (iForcePasvIp < op.iForcePasvIp)
  77. return true;
  78. #endif
  79. return false;
  80. }