#include <HttpCollection.h>
|
| virtual bool | onFileStart (const PartHeader &header, void **ppCallbackData, String &strCallbackError) |
| virtual bool | onFileData (const void *pData, size_t nSize, void *pCallbackData, String &strCallbackError) |
| virtual bool | onFileEnd (const PartHeader &header, void *pCallbackData, bool bDataSuccess, String &strCallbackError) |
| virtual | ~Object () |
| | Object () |
Definition at line 313 of file HttpCollection.h.
◆ StoredHttpFormData()
| StoredHttpFormData::StoredHttpFormData |
( |
const String & | strTempDir | ) |
|
Definition at line 1110 of file HttpCollection.cpp.
1111{
1113
1114 __tempDir = strTempDir;
1115
1116 __handle = new PointerArray;
1118}
#define __DCL_ASSERT(expr)
◆ ~StoredHttpFormData()
| StoredHttpFormData::~StoredHttpFormData |
( |
| ) |
|
|
virtual |
Definition at line 1120 of file HttpCollection.cpp.
1121{
1123 PointerArray* p =
__V();
1124 PointerArray& v = *p;
1125 for(size_t i = 0; i < v.size(); i++)
1126 delete (FileInfoArray*)v[i];
1127 v.clear();
1128 delete p;
1129}
◆ byName()
| StoredHttpFormData::FileInfoArray & StoredHttpFormData::byName |
( |
const wchar_t * | _name | ) |
|
Definition at line 1151 of file HttpCollection.cpp.
1153{
1155
1156 FileInfoArray* pV =
NULL;
1157 PointerArray& v = *(PointerArray*)__handle;
1158 for(size_t i = 0; i < v.size(); i++) {
1159 pV = (FileInfoArray*)(v[i]);
1160 if (pV->__name == _name)
1161 return *pV;
1162 }
1163
1164 pV = new FileInfoArray(_name);
1165 v.add(pV);
1166 return *pV;
1167}
◆ isEmpty()
| bool StoredHttpFormData::isEmpty |
( |
| ) |
const |
◆ onFileData()
| bool StoredHttpFormData::onFileData |
( |
const void * | pData, |
|
|
size_t | nSize, |
|
|
void * | pCallbackData, |
|
|
String & | strCallbackError ) |
|
protectedvirtual |
Reimplemented from HttpFormData.
Definition at line 1231 of file HttpCollection.cpp.
1237{
1238 StoredCallbackData* cb = (StoredCallbackData*)pCallbackData;
1240
1241 try {
1242 cb->
output->write(pData, nSize);
1244 }
1245 catch(IOException* e) {
1246 try {
1249 }
1250 catch(IOException* e) {
1253 }
1254
1255 delete cb;
1256
1259 return false;
1260 }
1261 return true;
1262}
#define __DCL_TRACE1(fmt, arg1)
static void unlink(const String &_path) __DCL_THROWS1(IOException *)
virtual String toString() const
FileOutputStream * output
◆ onFileEnd()
| bool StoredHttpFormData::onFileEnd |
( |
const PartHeader & | header, |
|
|
void * | pCallbackData, |
|
|
bool | bDataSuccess, |
|
|
String & | strCallbackError ) |
|
protectedvirtual |
Reimplemented from HttpFormData.
Definition at line 1264 of file HttpCollection.cpp.
1270{
1271 StoredCallbackData* cb = (StoredCallbackData*)pCallbackData;
1273 try {
1276 L"fileSize: %zd, dataSize: %zd\n",
1279 );
1280 }
1281 catch(IOException* e) {
1282 try {
1284 }
1285 catch(IOException* e) {
1288 }
1289
1292 delete cb;
1293 return false;
1294 }
1295
1296 if (bDataSuccess) {
1297 FileInfo* pInfo = new FileInfo;
1299 pInfo->filename = header.filename;
1300 pInfo->contentType = header.contentType;
1303
1304 insert(header.name, pInfo);
1305 }
1306
1307 delete cb;
1308 return true;
1309}
#define __DCL_TRACE2_N(fmt, arg1, arg2)
static uint64_t size(const String &_path) __DCL_THROWS1(IOException *)
◆ onFileStart()
| bool StoredHttpFormData::onFileStart |
( |
const PartHeader & | header, |
|
|
void ** | ppCallbackData, |
|
|
String & | strCallbackError ) |
|
protectedvirtual |
Reimplemented from HttpFormData.
Definition at line 1189 of file HttpCollection.cpp.
1194{
1195 String filename;
1196 FileOutputStream* output =
NULL;
1197 try {
1199 __tempDir,
1200 L"dclformdata"
1201 );
1202 output = new FileOutputStream(pFile);
1203 filename = pFile->
path();
1204 }
1205 catch(IOException* e) {
1206 if (!filename.isEmpty()) {
1207 try {
1209 }
1210 catch (IOException* e) {
1213 }
1214 }
1217 return false;
1218 }
1219
1220 StoredCallbackData* cb = new StoredCallbackData;
1225
1226 *ppCallbackData = cb;
1227
1228 return true;
1229}
static File * openTempFile(const String &_dirname, const String &_prefix, unsigned int _mode=0666) __DCL_THROWS1(IOException *)
const String & path() const
◆ operator[]()
| StoredHttpFormData::FileInfoArray & StoredHttpFormData::operator[] |
( |
size_t | _index | ) |
|
◆ size()
| size_t StoredHttpFormData::size |
( |
| ) |
const |
The documentation for this class was generated from the following files: