private SpecBindingState[] CreateSpecStateFrom(ISourceFile[] specs)
        {
            using (var ms = new MemoryStream())
            {
                var buildXLWriter = new BuildXLWriter(true, ms, true, true);
                FrontEndSnapshotSerializer.SerializeWorkspaceBindingSnapshot(new SourceFileBasedBindingSnapshot(specs, m_pathTable), buildXLWriter, m_pathTable);

                ms.Position = 0;
                var reader = new BuildXLReader(true, ms, true);
                return(FrontEndSnapshotSerializer.DeserializeSpecStates(reader, m_pathTable));
            }
        }
Ejemplo n.º 2
0
        private static SpecBindingSymbols Copy(SpecBindingSymbols symbols, SymbolTable symbolTable)
        {
            using (var ms = new MemoryStream())
            {
                BuildXLWriter writer = new BuildXLWriter(true, ms, true, true);
                FrontEndSnapshotSerializer.SerializeBindingSymbols(symbols, writer);

                ms.Position = 0;
                BuildXLReader reader = new BuildXLReader(true, ms, true);
                return(FrontEndSnapshotSerializer.DeserializeBindingFingerprint(reader));
            }
        }
Ejemplo n.º 3
0
        private static RoaringBitSet Copy(RoaringBitSet bitArray, PathTable pathTable)
        {
            bitArray.MaterializeSet(pathTable);

            using (var ms = new MemoryStream())
            {
                BuildXLWriter writer = new BuildXLWriter(true, ms, true, true);
                FrontEndSnapshotSerializer.SerializeBitSet(bitArray, writer);

                ms.Position = 0;
                BuildXLReader reader = new BuildXLReader(true, ms, true);
                return(FrontEndSnapshotSerializer.DeserializeBitVector(reader));
            }
        }