DCL 4.0
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

struct  _STORED_CALLBACK_DATA

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()

Typedefs

typedef struct _STORED_CALLBACK_DATA STORED_CALLBACK_DATA

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 846 of file HttpCollection.cpp.

◆ __V [2/2]

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

Definition at line 846 of file HttpCollection.cpp.

◆ CR

#define CR   '\r'

Definition at line 515 of file HttpCollection.cpp.

◆ EQUAL_STR

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

Definition at line 663 of file HttpCollection.cpp.

◆ LF

#define LF   '\n'

Definition at line 516 of file HttpCollection.cpp.

Typedef Documentation

◆ STORED_CALLBACK_DATA

Function Documentation

◆ __find_CHAR()

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

Definition at line 533 of file HttpCollection.cpp.

536{
537 while (_begin < _end) {
538 if (*_begin == _ch) {
539 return _begin;
540 }
541 _begin++;
542 }
543 return NULL;
544}
#define NULL
Definition Config.h:340

◆ __find_CRLF()

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

Definition at line 519 of file HttpCollection.cpp.

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

◆ IMPLEMENT_CLASSINFO() [1/5]

IMPLEMENT_CLASSINFO ( BufferedHttpFormData ,
HttpFormData  )

Definition at line 839 of file HttpCollection.cpp.

842{
843}

◆ IMPLEMENT_CLASSINFO() [2/5]

IMPLEMENT_CLASSINFO ( HttpFormData ,
Object  )

Definition at line 165 of file HttpCollection.cpp.

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

◆ IMPLEMENT_CLASSINFO() [3/5]

IMPLEMENT_CLASSINFO ( HttpFormDataDecoder ,
Object  )

Definition at line 276 of file HttpCollection.cpp.

281{
282 __input = NULL;
283 __contentLength = 0;
284 __remainder = 0;
285
286 __buffer = NULL;
287 __bufferSize = _bufferSize;
288 __begin = NULL;
289 __end = NULL;
290
291 __contentDisposition = "Content-Disposition";
292 __contentType = "Content-Type";
293 __name = "name";
294 __filename = "filename";
295
296}

◆ IMPLEMENT_CLASSINFO() [4/5]

IMPLEMENT_CLASSINFO ( HttpFormDataDecoderException ,
Exception  )

Definition at line 235 of file HttpCollection.cpp.

241 : Exception(pDetailEx)
242{
243 m_errorCode = errorCode;
244}

◆ IMPLEMENT_CLASSINFO() [5/5]

IMPLEMENT_CLASSINFO ( StoredHttpFormData ,
HttpFormData  )

Definition at line 1032 of file HttpCollection.cpp.

1038{
1039 fileSize = 0;
1040}