36 const std::string &fileName =
"",
37 const std::string &itemName =
"file",
38 ContentType contentType = CT_NONE)
39 : path_(filePath), itemName_(itemName), contentType_(contentType)
41 if (!fileName.empty())
47 auto pos = filePath.rfind(
'/');
48 if (pos != std::string::npos)
50 fileName_ = filePath.substr(pos + 1);
69 const std::string &fileName =
"memory.bin",
70 const std::string &itemName =
"file",
71 ContentType contentType = CT_APPLICATION_OCTET_STREAM)
76 contentType_(contentType)
80 const std::string &path()
const
85 const std::string &fileName()
const
90 const std::string &itemName()
const
95 ContentType contentType()
const
100 const void *data()
const
105 size_t dataLength()
const
111 const void *data_ =
nullptr;
114 std::string fileName_;
115 std::string itemName_;
116 ContentType contentType_;
UploadFile(const void *data, const size_t len, const std::string &fileName="memory.bin", const std::string &itemName="file", ContentType contentType=CT_APPLICATION_OCTET_STREAM)
Constructor.
Definition UploadFile.h:67
UploadFile(const std::string &filePath, const std::string &fileName="", const std::string &itemName="file", ContentType contentType=CT_NONE)
Constructor.
Definition UploadFile.h:35
Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...
Definition Attribute.h:23