Esempio n. 1
0
File: EmitEnums.cs Progetto: 0xCM/z0
        void Execute(ref uint counter, IRecordFormatter <ClrEnumRecord> formatter)
        {
            var src   = @readonly(Records);
            var t     = default(ClrEnumRecord);
            var count = src.Length;

            using var dst = Target.Writer();
            dst.WriteLine(formatter.FormatHeader());

            for (var i = 0u; i < count; i++)
            {
                ref readonly var record = ref skip(src, i);
Esempio n. 2
0
        public ExecToken Emit(ReadOnlySpan <BitMaskInfo> src, FS.FilePath dst)
        {
            var flow  = Wf.EmittingTable <BitMaskInfo>(dst);
            var count = src.Length;

            using var writer = dst.Writer();
            writer.WriteLine(Formatter.HeaderText);
            for (var i = 0u; i < count; i++)
            {
                writer.WriteLine(Formatter.Format(skip(src, i)));
            }
            return(Wf.EmittedTable <BitMaskInfo>(flow, count, dst));
        }
Esempio n. 3
0
        static EnumDataset <E, T> emit <E, T>(ReadOnlySpan <EnumLiteralInfo <E, T> > src, FS.FilePath dst)
            where E : unmanaged, Enum
            where T : unmanaged
        {
            using var writer = dst.Writer();
            writer.WriteLine(header <F>());

            var dataset = EnumDatasets.create <E, T>();

            for (var i = 0; i < src.Length; i++)
            {
                writer.WriteLine(EnumDatasets.format(src[i]));
            }
            return(dataset);
        }
Esempio n. 4
0
        static EnumDataset <E, T> EmitDataset <E, T>(FS.FilePath dst)
            where E : unmanaged, Enum
            where T : unmanaged
        {
            using var writer = dst.Writer();
            writer.WriteLine(header <F>());

            var dataset = EnumDatasets.create <E, T>();

            for (var i = 0; i < dataset.EntryCount; i++)
            {
                writer.WriteLine(EnumDatasets.format(dataset[i]));
            }
            return(dataset);
        }
Esempio n. 5
0
        public void Emit(Type src, FS.FilePath dst)
        {
            var flow = Wf.EmittingFile(dst);

            using var writer = dst.Writer();
            var patterns = Sources(src);
            var view     = patterns.View;

            var count = view.Length;

            for (var i = 0; i < count; i++)
            {
                writer.WriteLine(skip(view, i).Format());
            }

            Wf.EmittedFile(flow, count);
        }