DCL 3.7.4
Loading...
Searching...
No Matches
HttpCollection.cpp File Reference
#include <dcl/Config.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <dcl/Object.h>
#include <dcl/Numeric.h>
#include <dcl/URI.h>
#include <dcl/HttpServlet.h>
#include <dcl/HttpCollection.h>
#include <dcl/Array.h>
#include <dcl/Charset.h>
#include <dcl/BytesOutputStream.h>
#include <dcl/FileOutputStream.h>
#include <dcl/Files.h>

Go to the source code of this file.

Classes

class  StoredCallbackData

Macros

#define __DEBUG_THIS   0
#define __DCL_TRACE1_N(fmt, arg)
#define __DCL_TRACE2_N(fmt, arg1, arg2)
#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
#define CR   '\r'
#define LF   '\n'
#define EQUAL_STR(str, p)
#define __V()
#define __V()

Functions

 IMPLEMENT_CLASSINFO (HttpFormData, Object) String HttpFormData
 IMPLEMENT_CLASSINFO (HttpFormDataDecoderException, Exception) HttpFormDataDecoderException
 IMPLEMENT_CLASSINFO (HttpFormDataDecoder, Object) HttpFormDataDecoder
char * __find_CRLF (char *_begin, char *_end)
char * __find_CHAR (char *_begin, char *_end, char _ch)
 IMPLEMENT_CLASSINFO (BufferedHttpFormData, HttpFormData) BufferedHttpFormData
 IMPLEMENT_CLASSINFO (StoredHttpFormData, HttpFormData) StoredHttpFormData

Macro Definition Documentation

◆ __DCL_TRACE1_N

#define __DCL_TRACE1_N ( fmt,
arg )

Definition at line 35 of file HttpCollection.cpp.

◆ __DCL_TRACE2_N

#define __DCL_TRACE2_N ( fmt,
arg1,
arg2 )

Definition at line 36 of file HttpCollection.cpp.

◆ __DCL_TRACE3_N

#define __DCL_TRACE3_N ( fmt,
arg1,
arg2,
arg3 )

Definition at line 37 of file HttpCollection.cpp.

◆ __DEBUG_THIS

#define __DEBUG_THIS   0

Definition at line 29 of file HttpCollection.cpp.

◆ __V [1/2]

#define __V ( )
Value:
((PointerArray*)__handle)

Definition at line 847 of file HttpCollection.cpp.

◆ __V [2/2]

#define __V ( )
Value:
((PointerArray*)__handle)

Definition at line 847 of file HttpCollection.cpp.

◆ CR

#define CR   '\r'

Definition at line 518 of file HttpCollection.cpp.

◆ EQUAL_STR

#define EQUAL_STR ( str,
p )
Value:
(!(str).compareNoCase((p), str.length()))

Definition at line 666 of file HttpCollection.cpp.

◆ LF

#define LF   '\n'

Definition at line 519 of file HttpCollection.cpp.

Function Documentation

◆ __find_CHAR()

char * __find_CHAR ( char * _begin,
char * _end,
char _ch )
inline

Definition at line 536 of file HttpCollection.cpp.

539{
540 while (_begin < _end) {
541 if (*_begin == _ch) {
542 return _begin;
543 }
544 _begin++;
545 }
546 return NULL;
547}
#define NULL
Definition Config.h:312

◆ __find_CRLF()

char * __find_CRLF ( char * _begin,
char * _end )
inline

Definition at line 522 of file HttpCollection.cpp.

525{
526 _end--;
527 while (_begin < _end) {
528 if (*_begin == CR && *(_begin + 1) == LF) {
529 return _begin;
530 }
531 _begin++;
532 }
533 return NULL;
534}
#define LF
#define CR

◆ IMPLEMENT_CLASSINFO() [1/5]

IMPLEMENT_CLASSINFO ( BufferedHttpFormData ,
HttpFormData  )

Definition at line 840 of file HttpCollection.cpp.

843{
844}

◆ IMPLEMENT_CLASSINFO() [2/5]

IMPLEMENT_CLASSINFO ( HttpFormData ,
Object  )

Definition at line 166 of file HttpCollection.cpp.

169{
170 StringBuilder sb;
171 sb.append(L"type[").append(type)
172 .append(L"], name[").append(name)
173 .append(L"], filename[").append(filename)
174 .append(L"], contentType[").append(contentType)
175 .append(L"]");
176 return sb;
177}
178
179// default file handler
180// data ignored
181
182bool HttpFormData::onFileStart(
183 const PartHeader& header,
184 void** ppCallbackData,
185 String& strCallbackError // return false 이면
186)
187{
188#ifdef __DCL_DEBUG
189 size_t* pTotalSize = new size_t;
190 __DCL_ASSERT(pTotalSize != NULL);
191
192 *pTotalSize = 0;
193
194 *ppCallbackData = pTotalSize;
195#endif
196 return true;
197}
#define __DCL_ASSERT(expr)
Definition Object.h:394

◆ IMPLEMENT_CLASSINFO() [3/5]

IMPLEMENT_CLASSINFO ( HttpFormDataDecoder ,
Object  )

Definition at line 282 of file HttpCollection.cpp.

287{
288 __input = NULL;
289 __contentLength = 0;
290 __remainder = 0;
291
292 __buffer = NULL;
293 __bufferSize = _bufferSize;
294 __begin = NULL;
295 __end = NULL;
296
297 __contentDisposition = "Content-Disposition";
298 __contentType = "Content-Type";
299 __name = "name";
300 __filename = "filename";
301
302}

◆ IMPLEMENT_CLASSINFO() [4/5]

IMPLEMENT_CLASSINFO ( HttpFormDataDecoderException ,
Exception  )

Definition at line 243 of file HttpCollection.cpp.

248 : Exception(_cause)
249{
250 __errorCode = _errorCode;
251}

◆ IMPLEMENT_CLASSINFO() [5/5]

IMPLEMENT_CLASSINFO ( StoredHttpFormData ,
HttpFormData  )

Definition at line 1032 of file HttpCollection.cpp.

1038{
1039 fileSize = 0;
1040}