TestUtil.h 808 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "common.h"
  2. #include <string>
  3. #include "Cookie.h"
  4. namespace aria2 {
  5. void createFile(const std::string& filename, size_t length);
  6. std::string readFile(const std::string& path);
  7. class CookieSorter {
  8. public:
  9. bool operator()(const Cookie& lhs, const Cookie& rhs) const
  10. {
  11. if(lhs.getDomain() == rhs.getDomain()) {
  12. return lhs.getName() < rhs.getName();
  13. } else {
  14. return lhs.getDomain() < rhs.getDomain();
  15. }
  16. }
  17. };
  18. Cookie createCookie
  19. (const std::string& name,
  20. const std::string& value,
  21. const std::string& domain,
  22. bool hostOnly,
  23. const std::string& path,
  24. bool secure);
  25. Cookie createCookie
  26. (const std::string& name,
  27. const std::string& value,
  28. time_t expiryTime,
  29. const std::string& domain,
  30. bool hostOnly,
  31. const std::string& path,
  32. bool secure);
  33. } // namespace aria2