comparison OrthancFramework/Sources/HttpServer/IWebDavBucket.h @ 4252:f047e2734655

fix webdav
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 15 Oct 2020 17:13:35 +0200
parents 6c3721ff284c
children 2221051b42df
comparison
equal deleted inserted replaced
4250:cbf9afa17415 4252:f047e2734655
36 #include <boost/date_time/posix_time/posix_time.hpp> 36 #include <boost/date_time/posix_time/posix_time.hpp>
37 #include <boost/noncopyable.hpp> 37 #include <boost/noncopyable.hpp>
38 #include <pugixml.hpp> 38 #include <pugixml.hpp>
39 39
40 #include <list> 40 #include <list>
41 #include <set>
41 42
42 namespace Orthanc 43 namespace Orthanc
43 { 44 {
44 class HttpOutput; 45 class HttpOutput;
45 46
47 { 48 {
48 public: 49 public:
49 class Resource : public boost::noncopyable 50 class Resource : public boost::noncopyable
50 { 51 {
51 private: 52 private:
52 std::string name_; 53 std::string displayName_;
53 bool hasModificationTime_; 54 bool hasModificationTime_;
54 boost::posix_time::ptime creationTime_; 55 boost::posix_time::ptime creationTime_;
55 boost::posix_time::ptime modificationTime_; 56 boost::posix_time::ptime modificationTime_;
56 57
57 protected:
58 void SetNameInternal(const std::string& name);
59
60 public: 58 public:
61 Resource(); 59 Resource(const std::string& displayName);
62 60
63 virtual ~Resource() 61 virtual ~Resource()
64 { 62 {
65 } 63 }
66 64
67 void SetCreationTime(const boost::posix_time::ptime& t); 65 void SetCreationTime(const boost::posix_time::ptime& t);
68 66
69 void SetModificationTime(const boost::posix_time::ptime& t); 67 void SetModificationTime(const boost::posix_time::ptime& t);
70 68
71 const std::string& GetName() const 69 const std::string& GetDisplayName() const
72 { 70 {
73 return name_; 71 return displayName_;
74 } 72 }
75 73
76 const boost::posix_time::ptime& GetCreationTime() const 74 const boost::posix_time::ptime& GetCreationTime() const
77 { 75 {
78 return creationTime_; 76 return creationTime_;
93 private: 91 private:
94 uint64_t contentLength_; 92 uint64_t contentLength_;
95 MimeType mime_; 93 MimeType mime_;
96 94
97 public: 95 public:
98 File(const std::string& name); 96 File(const std::string& displayName);
99 97
100 void SetContentLength(uint64_t contentLength) 98 void SetContentLength(uint64_t contentLength)
101 { 99 {
102 contentLength_ = contentLength; 100 contentLength_ = contentLength;
103 } 101 }
125 123
126 124
127 class Folder : public Resource 125 class Folder : public Resource
128 { 126 {
129 public: 127 public:
130 Folder(const std::string& name) 128 Folder(const std::string& displayName) :
129 Resource(displayName)
131 { 130 {
132 SetNameInternal(name);
133 } 131 }
134 132
135 virtual void Format(pugi::xml_node& node, 133 virtual void Format(pugi::xml_node& node,
136 const std::string& parentPath) const ORTHANC_OVERRIDE; 134 const std::string& parentPath) const ORTHANC_OVERRIDE;
137 }; 135 };
147 145
148 size_t GetSize() const 146 size_t GetSize() const
149 { 147 {
150 return resources_.size(); 148 return resources_.size();
151 } 149 }
150
151 void ListDisplayNames(std::set<std::string>& target);
152 152
153 void AddResource(Resource* resource); // Takes ownership 153 void AddResource(Resource* resource); // Takes ownership
154 154
155 void Format(std::string& target, 155 void Format(std::string& target,
156 const std::string& parentPath) const; 156 const std::string& parentPath) const;