FirefoxAddonUpdater.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2002-2009 Moxie Marlinspike
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 3 of the
  7. * License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  17. * USA
  18. */
  19. #ifndef __FIREFOX_ADDON_UPDATER_H__
  20. #define __FIREFOX_ADDON_UPDATER_H__
  21. #include <boost/asio.hpp>
  22. #include <boost/shared_ptr.hpp>
  23. #include "FirefoxUpdater.hpp"
  24. using namespace boost::asio;
  25. class FirefoxAddonUpdater : public FirefoxUpdater {
  26. private:
  27. std::map<std::string, std::string> requestArguments;
  28. std::string incrementVersion(std::string &version);
  29. bool parseArguments(std::string &request, std::vector<std::string> &arguments);
  30. std::string truncateVersion(std::string &version);
  31. protected:
  32. virtual bool parseMetaRequest(std::string &request);
  33. public:
  34. virtual void sendMetaUpdateResponse();
  35. FirefoxAddonUpdater(boost::shared_ptr<ip::tcp::socket> clientSocket,
  36. ip::tcp::endpoint &destination)
  37. : FirefoxUpdater(clientSocket, destination) {}
  38. };
  39. #endif