コード例 #1
0
 private static void GenerateEvents(IntPtr pNativeEmitter, IList <YDocument> documents)
 {
     GenerateEvent(pNativeEmitter, x => CreateEventStreamStart((YamlEvent *)x, YamlEncoding.YAML_ANY_ENCODING));
     foreach (var document in documents)
     {
         YamlVersionDirective *NO_VERSION_DIRECTIVE    = null;
         YamlTagDirective *    NO_TAG_DIRECTIVE        = null;
         const int             DOCUMENT_START_EXPLICIT = 0;
         GenerateEvent(pNativeEmitter, x => CreateEventDocumentStart((YamlEvent *)x, NO_VERSION_DIRECTIVE, NO_TAG_DIRECTIVE, NO_TAG_DIRECTIVE, DOCUMENT_START_EXPLICIT));
         var visited    = new HashSet <YNode>();
         var duplicates = new HashSet <YNode>();
         FindDuplicateNodes(document, visited, duplicates);
         var aliases = GenerateAliases(duplicates);
         visited.Clear();
         GenerateNodeEvents(pNativeEmitter, document.Root, aliases, visited);
         const int DOCUMENT_END_IMPLICIT = 1;
         GenerateEvent(pNativeEmitter, x => CreateEventDocumentEnd((YamlEvent *)x, DOCUMENT_END_IMPLICIT));
     }
     GenerateEvent(pNativeEmitter, x => CreateEventStreamEnd((YamlEvent *)x));
 }
コード例 #2
0
 private static extern int CreateEventDocumentStart(
     YamlEvent *pEvent,
     YamlVersionDirective *pVersionDirective,
     YamlTagDirective *pTagDirectivesStart,
     YamlTagDirective *pTagDirectivesEnd,
     int aImplicit);