FzApiStructures.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. port = 0;
  19. fwbypass = FALSE;
  20. bDontRememberPass = FALSE;
  21. nServerType = 0;
  22. nPasv = 0;
  23. nTimeZoneOffset = 0;
  24. nUTF8 = 0;
  25. iForcePasvIp = 0;
  26. }
  27. t_server::~t_server()
  28. {
  29. }
  30. const bool operator == (const t_server &a,const t_server &b)
  31. {
  32. if (a.host!=b.host)
  33. return false;
  34. if (a.port!=b.port)
  35. return false;
  36. if (a.user!=b.user)
  37. return false;
  38. if (a.account != b.account)
  39. return false;
  40. if (a.pass!=b.pass && a.user!=_MPT("anonymous"))
  41. return false;
  42. if (a.nServerType!=b.nServerType)
  43. return false;
  44. if (a.nPasv != b.nPasv)
  45. return false;
  46. if (a.nTimeZoneOffset != b.nTimeZoneOffset)
  47. return false;
  48. if (a.nUTF8 != b.nUTF8)
  49. return false;
  50. #ifdef MPEXT
  51. if (a.iForcePasvIp != b.iForcePasvIp)
  52. return false;
  53. #endif
  54. return true;
  55. }
  56. const bool operator != (const t_server &a,const t_server &b)
  57. {
  58. return !(a == b);
  59. }
  60. bool t_server::operator<(const t_server &op) const
  61. {
  62. if (host<op.host)
  63. return true;
  64. if (port<op.port)
  65. return true;
  66. if (user<op.user)
  67. return true;
  68. if (account<op.account)
  69. return true;
  70. if (pass<op.pass)
  71. return true;
  72. if (nServerType<op.nServerType)
  73. return true;
  74. if (nPasv < op.nPasv)
  75. return true;
  76. if (nTimeZoneOffset < op.nTimeZoneOffset)
  77. return true;
  78. if (nUTF8 < op.nUTF8)
  79. return true;
  80. #ifdef MPEXT
  81. if (iForcePasvIp < op.iForcePasvIp)
  82. return true;
  83. #endif
  84. return false;
  85. }