ChipMaster's trial hacks on C++CMS starting with v1.2.1. Not sure I'll follow on with the v2 since it looks to be breaking and mostly frivolous.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
743 B

  1. #ifndef CPPCMS_HTTP_FILE_H
  2. #define CPPCMS_HTTP_FILE_H
  3. #include "defs.h"
  4. #include "hold_ptr.h"
  5. #include "noncopyable.h"
  6. #include <sstream>
  7. #include <fstream>
  8. namespace cppcms { namespace http {
  9. class request;
  10. class CPPCMS_API file {
  11. public:
  12. std::string name() const;
  13. std::string mime() const;
  14. std::string filename() const;
  15. std::istream &data();
  16. size_t size() const;
  17. file();
  18. ~file();
  19. private:
  20. std::string name_;
  21. std::string mime_;
  22. std::string filename_;
  23. size_t size_;
  24. std::fstream file_;
  25. std::stringstream file_data_;
  26. uint32_t saved_in_file_ : 1;
  27. uint32_t reserverd_ : 31;
  28. struct impl_data; // for future use
  29. util::hold_ptr<impl_data> d;
  30. friend class request;
  31. };
  32. } } //::cppcms::http
  33. #endif