cpiNextParserClassName

This function returns the name of the next parser class in the chain, if defined. Use this function to return to the integration node the name of the parser class that handles the next section, or remainder, of the message content. Typically, for messages that have a simple format type, only one message content parser is defined.

For messages that have a more complex format type with multiple message parsers, each parser can identify the next one in the chain by returning its name in the buffer parameter. The last parser in the chain must return an empty string.

If you specify the name of a parser supplied with IBM® App Connect Enterprise, you must use the correct class name of the parser.

Defined In Type Member
CPI_VFT Optional iFpNextParserClassName

Syntax

void cpiNextParserClassName(
  CciParser*   parser,
  CciContext*  context,
  CciChar*     buffer,
  int          size);

Parameters

parser
The address of the parser object (input).
context
The address of the context owned by the parser object (input).
buffer
The address of a buffer into which the parser class name should be put (input).
size
The length, in bytes, of the buffer provided by the integration node (input).

Return values

None.

Sample

This example is taken from the sample parser file BipSampPluginParser.c:

void cpiNextParserClassName(
  CciParser*  parser,
  CciContext* context,
  CciChar*    buffer,
  int         size
){
  PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
  int                rc = 0;

  if (pc->trace) {
    fprintf(pc->tracefile, "PLUGIN: -> cpiNextParserClassName() parser=0x%x context=0x%x\n",
            parser, context);
    fflush(pc->tracefile);
  }

  /* Copy the name to the integration node */
  CciCharNCpy(buffer, pc->iNextParserClassName, size);

  if (pc->trace) {
    fprintf(pc->tracefile, "PLUGIN: <- cpiNextParserClassName()\n");
    fflush(pc->tracefile);
  }

  return;
}