TestUtil.h 470 B

12345678910111213141516171819202122232425
  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. } // namespace aria2