FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
Extract_And_Process_Document_Stream Class Referenceabstract

Scan streams of data for start and end tags, invokes processDocument() on found content. More...

#include <read_file.hpp>

+ Inheritance diagram for Extract_And_Process_Document_Stream:

Public Member Functions

 Extract_And_Process_Document_Stream (const char *docStart, const char *endTag, size_t maxDocSize=1024 *128)
 
virtual ~Extract_And_Process_Document_Stream ()
 
int scanAndProcessBuffer (const unsigned char *block, size_t blockLen)
 
int scanAndProcessBuffer (File_Buffer *bfrState)
 
int addIOblockThenProcess (SharedBufferAllocRecord *rec, IO_Processor *controller)
 Specialized interface to add incoming block from BufferRegion maintained by an IO_Processor. Block content is appended and then returned before any processing of the content is attempted. More...
 
virtual int processDocument (unsigned char *docStart, size_t docLen)=0
 User-exit to process extracted document. More...
 
virtual int_fast32_t processBlock (unsigned char *blockStart, size_t blockLen)
 User-exit to process block of raw data. More...
 

Protected Types

enum  { FIND_NOTHING =0, FIND_DOC_START =1, FIND_END_TAG =2, FIND_BLOCK_LENGTH =3 }
 

Protected Member Functions

int scanForDocument ()
 

Protected Attributes

enum Extract_And_Process_Document_Stream:: { ... }  scanState
 
enum Extract_And_Process_Document_Stream:: { ... }  restartScanState
 
unsigned char documentStartPrefix [64]
 
unsigned char documentEndTag [64]
 
File_BufferpendingContent
 
ssize_t neededBlockLen
 
size_t documentStartLen
 
size_t documentEndLen
 

Detailed Description

Scan streams of data for start and end tags, invokes processDocument() on found content.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
FIND_NOTHING 
FIND_DOC_START 
FIND_END_TAG 
FIND_BLOCK_LENGTH 

Constructor & Destructor Documentation

◆ Extract_And_Process_Document_Stream()

Extract_And_Process_Document_Stream::Extract_And_Process_Document_Stream ( const char *  docStart,
const char *  endTag,
size_t  maxDocSize = 1024*128 
)
inline

◆ ~Extract_And_Process_Document_Stream()

virtual Extract_And_Process_Document_Stream::~Extract_And_Process_Document_Stream ( )
inlinevirtual

References pendingContent.

Member Function Documentation

◆ addIOblockThenProcess()

int Extract_And_Process_Document_Stream::addIOblockThenProcess ( SharedBufferAllocRecord rec,
IO_Processor controller 
)
inline

Specialized interface to add incoming block from BufferRegion maintained by an IO_Processor. Block content is appended and then returned before any processing of the content is attempted.

This interface exists to handle a very exotic scenario in which the BufferRegion will be taken over by a child routine invoked by scanForDocument() and the BufferRegion must have no blocks in use at the time of the call.

References app(), File_Buffer::appendDataToBuffer(), IO_Processor::bfrManager, IO_Processor::bufferAddress(), File_Buffer::discardInitialBytes(), LOG_COMPONENT_CERR, LOG_ENDLINE, OME_EXPECT_FALSE, pendingContent, BufferRegion::returnBlock(), scanForDocument(), and File_Buffer::spaceLeft().

Referenced by HTTPembeddedServerBase::readHTTPstream().

◆ processBlock()

virtual int_fast32_t Extract_And_Process_Document_Stream::processBlock ( unsigned char *  blockStart,
size_t  blockLen 
)
inlinevirtual

User-exit to process block of raw data.

Will be invoked if processDocument() returns a value greater than 0.

Reimplemented in Parse_And_Process_HTTP_Stream, and HTTP_SessionRecord.

Referenced by scanForDocument().

◆ processDocument()

virtual int Extract_And_Process_Document_Stream::processDocument ( unsigned char *  docStart,
size_t  docLen 
)
pure virtual

User-exit to process extracted document.

Returns
Number of bytes of required for a subsequent block of raw data.
Return values
0indicates no block of raw data is required.
-1indicates some error.

Implemented in Parse_And_Process_HTTP_Stream.

◆ scanAndProcessBuffer() [1/2]

int Extract_And_Process_Document_Stream::scanAndProcessBuffer ( const unsigned char *  block,
size_t  blockLen 
)
inline

◆ scanAndProcessBuffer() [2/2]

int Extract_And_Process_Document_Stream::scanAndProcessBuffer ( File_Buffer bfrState)
inline

◆ scanForDocument()

Member Data Documentation

◆ documentEndLen

size_t Extract_And_Process_Document_Stream::documentEndLen
protected

◆ documentEndTag

unsigned char Extract_And_Process_Document_Stream::documentEndTag[64]
protected

◆ documentStartLen

size_t Extract_And_Process_Document_Stream::documentStartLen
protected

◆ documentStartPrefix

unsigned char Extract_And_Process_Document_Stream::documentStartPrefix[64]
protected

◆ neededBlockLen

ssize_t Extract_And_Process_Document_Stream::neededBlockLen
protected

◆ pendingContent

◆ restartScanState

enum { ... } Extract_And_Process_Document_Stream::restartScanState

◆ scanState

enum { ... } Extract_And_Process_Document_Stream::scanState

The documentation for this class was generated from the following files:
Generated: Tue Jul 28 2020 16:03:27
Support Information