private static extern int CreateEventScalar( YamlEvent *pEvent, YamlString anchor, YamlString tag, YamlString value, int aLength, int aPlainImplicit, int aQuotedImplicit, YamlScalarStyle aStyle);
private static int ParseYamlEvent(IntPtr pNativeParser, YamlEvent *pEvent) { int returnCode = 0; try { var builder = parsers[pNativeParser]; switch (pEvent->type) { case YamlEventType.YAML_STREAM_START_EVENT: builder.StreamStart(); break; case YamlEventType.YAML_STREAM_END_EVENT: builder.StreamEnd(); break; case YamlEventType.YAML_DOCUMENT_START_EVENT: builder.DocumentStart(); break; case YamlEventType.YAML_DOCUMENT_END_EVENT: builder.DocumentEnd(); break; case YamlEventType.YAML_ALIAS_EVENT: builder.Alias(pEvent->data.alias.anchor); break; case YamlEventType.YAML_SCALAR_EVENT: builder.Scalar(pEvent->data.scalar.anchor, pEvent->data.scalar.tag, pEvent->data.scalar.value); break; case YamlEventType.YAML_SEQUENCE_START_EVENT: builder.SequenceStart(pEvent->data.scalar.anchor, pEvent->data.scalar.tag); break; case YamlEventType.YAML_SEQUENCE_END_EVENT: builder.SequenceEnd(); break; case YamlEventType.YAML_MAPPING_START_EVENT: builder.MappingStart(pEvent->data.scalar.anchor, pEvent->data.scalar.tag); break; case YamlEventType.YAML_MAPPING_END_EVENT: builder.MappingEnd(); break; default: break; } } catch { // Don't allow exceptions to get back to unmanaged caller. // Non-zero indicates an error. returnCode = 1; } return(returnCode); }
private static extern void DestroyEvent(YamlEvent *pEvent);
private static extern int CreateEventAlias(YamlEvent *pEvent, YamlString alias);
private static extern int CreateEventMappingEnd(YamlEvent *pEvent);
private static extern int CreateEventMappingStart( YamlEvent *pEvent, YamlString anchor, YamlString tag, int aImplicit, YamlMappingStyle aStyle);
private static extern int CreateEventSequenceEnd(YamlEvent *pEvent);
private static extern int CreateEventDocumentEnd( YamlEvent *pEvent, int aImplicit);
private static extern int CreateEventDocumentStart( YamlEvent *pEvent, YamlVersionDirective *pVersionDirective, YamlTagDirective *pTagDirectivesStart, YamlTagDirective *pTagDirectivesEnd, int aImplicit);
private static extern int CreateEventStreamEnd(YamlEvent *pEvent);
private static extern int CreateEventStreamStart( YamlEvent *pEvent, YamlEncoding aEncoding);
private static extern int Emit( IntPtr pNativeEmitter, YamlEvent *pEvent);