home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 217 / DPCS0306DVD.ISO / Toolkit / Internet / FileZilla / Server / FileZilla_Server-0.9.11.exe / source / Options.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-11-02  |  2.6 KB  |  87 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. #if !defined(AFX_OPTIONS_H__3E60F2D3_99F3_4271_92A3_2CF71AF62731__INCLUDED_)
  20. #define AFX_OPTIONS_H__3E60F2D3_99F3_4271_92A3_2CF71AF62731__INCLUDED_
  21.  
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif // _MSC_VER > 1000
  25.  
  26. #include "OptionTypes.h"
  27. #include "SpeedLimit.h"
  28.  
  29. class CMarkupSTL;
  30. class COptionsHelperWindow;
  31. class COptions
  32. {
  33.     friend COptionsHelperWindow;
  34.  
  35. public:
  36.     BOOL GetAsCommand(char **pBuffer, DWORD *nBufferLength);
  37.     CStdString GetOption(int nOptionID);
  38.     _int64 GetOptionVal(int nOptionID);
  39.  
  40.     COptions();
  41.     virtual ~COptions();
  42.  
  43.     static CMarkupSTL *GetXML();
  44.     static BOOL FreeXML(CMarkupSTL *pXML);
  45.  
  46.     BOOL ParseOptionsCommand(unsigned char *pData, DWORD dwDataLength, BOOL bFromLocal = FALSE);
  47.     void SetOption(int nOptionID, LPCTSTR value);
  48.     void SetOption(int nOptionID, _int64 value);
  49.     int GetCurrentSpeedLimit(int nMode);
  50.     void ReloadConfig();
  51.  
  52. protected:
  53.  
  54.     static CCriticalSectionWrapper m_Sync;
  55.     static std::list<COptions *> m_InstanceList;
  56.     static bool IsNumeric(LPCTSTR str);
  57.  
  58.     BOOL ReadSpeedLimits(CMarkupSTL *pXML);
  59.     BOOL SaveSpeedLimits();
  60.  
  61.     static SPEEDLIMITSLIST m_sDownloadSpeedLimits;
  62.     static SPEEDLIMITSLIST m_sUploadSpeedLimits;
  63.     SPEEDLIMITSLIST m_DownloadSpeedLimits;
  64.     SPEEDLIMITSLIST m_UploadSpeedLimits;
  65.  
  66.     struct t_OptionsCache
  67.     {
  68.         BOOL bCached;
  69.         int nType;
  70.         CStdString str;
  71.         _int64 value;
  72.     } m_OptionsCache[OPTIONS_NUM];
  73.     static t_OptionsCache m_sOptionsCache[OPTIONS_NUM];
  74.  
  75.     void Init();
  76.     static BOOL m_bInitialized;
  77.  
  78.     static void UpdateInstances();
  79.     COptionsHelperWindow *m_pOptionsHelperWindow;
  80. };
  81.  
  82.  
  83. //{{AFX_INSERT_LOCATION}}
  84. // Microsoft Visual C++ fⁿgt unmittelbar vor der vorhergehenden Zeile zusΣtzliche Deklarationen ein.
  85.  
  86. #endif // AFX_OPTIONS_H__3E60F2D3_99F3_4271_92A3_2CF71AF62731__INCLUDED_
  87.