#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 315 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 1229 of file HttpCollection.cpp.
1235{
1238
1239 try {
1240 pCB->
output->write(pData, nSize);
1242 }
1243 catch(IOException* e) {
1244 try {
1247 }
1248 catch(IOException* e) {
1251 }
1252
1253 delete pCB;
1254
1257 return false;
1258 }
1259 return true;
1260}
struct _STORED_CALLBACK_DATA STORED_CALLBACK_DATA
#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 1262 of file HttpCollection.cpp.
1268{
1271 try {
1273
1275 L"fileSize: %zd, dataSize: %zd\n",
1278 );
1279 }
1280 catch(IOException* e) {
1281 try {
1283 }
1284 catch(IOException* e) {
1287 }
1288
1291 delete pCB;
1292
1293 return false;
1294 }
1295
1296
1297 if (bDataSuccess) {
1298 FileInfo* pInfo = new FileInfo;
1299
1301
1302 pInfo->filename = header.filename;
1303 pInfo->contentType = header.contentType;
1306
1307 insert(header.name, pInfo);
1308 }
1309
1310 delete pCB;
1311
1312 return true;
1313}
#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 1187 of file HttpCollection.cpp.
1192{
1193 String filename;
1194 FileOutputStream* pOut =
NULL;
1195 try {
1197 __tempDir,
1198 L"dclformdata"
1199 );
1200 pOut = new FileOutputStream(pFile);
1201 filename = pFile->
path();
1202 }
1203 catch(IOException* e) {
1204 if (!filename.isEmpty()) {
1205 try {
1207 }
1208 catch (IOException* e) {
1211 }
1212 }
1215 return false;
1216 }
1217
1223
1224 *ppCallbackData = pCB;
1225
1226 return true;
1227}
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: