diff --git a/CMakePresets.json b/CMakePresets.json index 671dff6aa..99fb33f0d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -32,8 +32,8 @@ "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", "EXTERNALS_ROOT": "${sourceDir}/externals/windows", "CONFIG_DEFAULTS_PATH": "config/profiles/default/*.conf", - "DOTNET_BINARY_DIR": "${sourceDir}/build/$/bin/net7.0", - "DOTNET_WINDOWS_BINARY_DIR": "${sourceDir}/build/$/bin/net7.0-windows", + "DOTNET_BINARY_DIR": "${sourceDir}/build/$/bin/net8.0", + "DOTNET_WINDOWS_BINARY_DIR": "${sourceDir}/build/$/bin/net8.0-windows", "EXPORT_MD_CONSUMER": { "type": "BOOL", "value": "ON" @@ -187,7 +187,7 @@ "CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3", "CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}", "CONFIG_DEFAULTS_PATH": "config/profiles/default/*.conf", - "DOTNET_BINARY_DIR": "${sourceDir}/build/$/bin/net7.0", + "DOTNET_BINARY_DIR": "${sourceDir}/build/$/bin/net8.0", "EXPORT_MD_CONSUMER": { "type": "BOOL", "value": "ON" diff --git a/src/DataStreamSuite/ArithmeticExpressions/ArithmeticExpressions.csproj b/src/DataStreamSuite/ArithmeticExpressions/ArithmeticExpressions.csproj index 540083b1e..de9b9af58 100644 --- a/src/DataStreamSuite/ArithmeticExpressions/ArithmeticExpressions.csproj +++ b/src/DataStreamSuite/ArithmeticExpressions/ArithmeticExpressions.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/BaseUtilities/BaseUtilities.csproj b/src/DataStreamSuite/BaseUtilities/BaseUtilities.csproj index 53304f092..c1f4915a8 100644 --- a/src/DataStreamSuite/BaseUtilities/BaseUtilities.csproj +++ b/src/DataStreamSuite/BaseUtilities/BaseUtilities.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/BlueRegistry/BlueRegistry.csproj b/src/DataStreamSuite/BlueRegistry/BlueRegistry.csproj index cfadb03dd..30402ac0e 100644 --- a/src/DataStreamSuite/BlueRegistry/BlueRegistry.csproj +++ b/src/DataStreamSuite/BlueRegistry/BlueRegistry.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/BooleanExpressions/BooleanExpressions.csproj b/src/DataStreamSuite/BooleanExpressions/BooleanExpressions.csproj index ed44e6f2f..dd87d709a 100644 --- a/src/DataStreamSuite/BooleanExpressions/BooleanExpressions.csproj +++ b/src/DataStreamSuite/BooleanExpressions/BooleanExpressions.csproj @@ -1,14 +1,14 @@ - net7.0 + net8.0 enable enable - + diff --git a/src/DataStreamSuite/BooleanExpressions/GplexBuffers.cs b/src/DataStreamSuite/BooleanExpressions/GplexBuffers.cs index 76dd35443..96bdeeee5 100644 --- a/src/DataStreamSuite/BooleanExpressions/GplexBuffers.cs +++ b/src/DataStreamSuite/BooleanExpressions/GplexBuffers.cs @@ -24,8 +24,6 @@ namespace QUT.GplexBuffers public BufferException(string message) : base(message) { } public BufferException(string message, Exception innerException) : base(message, innerException) { } - protected BufferException(SerializationInfo info, StreamingContext context) - : base(info, context) { } } internal abstract class ScanBuff @@ -60,12 +58,10 @@ namespace QUT.GplexBuffers return new BuildBuffer(source); } -#if (!BYTEMODE) public static ScanBuff GetBuffer(Stream source, int fallbackCodePage) { return new BuildBuffer(source, fallbackCodePage); } -#endif // !BYTEMODE #endif // !NOFILES } @@ -353,17 +349,15 @@ namespace QUT.GplexBuffers { FileStream fStrm = (stream as FileStream); if (fStrm != null) FileName = fStrm.Name; - NextBlk = BlockReaderFactory.Raw(stream); + NextBlk = BlockReaderFactory.Get(stream); } -#if (!BYTEMODE) public BuildBuffer(Stream stream, int fallbackCodePage) { FileStream fStrm = (stream as FileStream); if (fStrm != null) FileName = fStrm.Name; NextBlk = BlockReaderFactory.Get(stream, fallbackCodePage); } -#endif /// /// Marks a conservative lower bound for the buffer, @@ -434,43 +428,19 @@ namespace QUT.GplexBuffers // internal static class BlockReaderFactory { - public static BlockReader Raw(Stream stream) - { - return delegate(char[] block, int index, int number) - { - byte[] b = new byte[number]; - int count = stream.Read(b, 0, number); - int i = 0; - int j = index; - for (; i < count; i++, j++) - block[j] = (char)b[i]; - return count; - }; - } -#if (!BYTEMODE) - public static BlockReader Get(Stream stream, int fallbackCodePage) + public static BlockReader Get(Stream stream, int fallbackCodePage = -2) { Encoding encoding; int preamble = Preamble(stream); if (preamble != 0) // There is a valid BOM here! encoding = Encoding.GetEncoding(preamble); - else if (fallbackCodePage == -1) // Fallback is "raw" bytes - return Raw(stream); - else if (fallbackCodePage != -2) // Anything but "guess" + else if (fallbackCodePage >= 0) // Anything but "guess" encoding = Encoding.GetEncoding(fallbackCodePage); else // This is the "guess" option - { - int guess = new Guesser(stream).GuessCodePage(); - stream.Seek(0, SeekOrigin.Begin); - if (guess == -1) // ==> this is a 7-bit file - encoding = Encoding.ASCII; - else if (guess == 65001) - encoding = Encoding.UTF8; - else // ==> use the machine default - encoding = Encoding.Default; - } + encoding = GuessEncoding(stream); + StreamReader reader = new StreamReader(stream, encoding); return reader.Read; } @@ -488,6 +458,14 @@ namespace QUT.GplexBuffers int b2 = stream.ReadByte(); if (b0 == 0xef && b1 == 0xbb && b2 == 0xbf) return 65001; // UTF8 + + int b3 = stream.ReadByte(); + // Check for UTF-32 BOM (Byte Order Mark) + if (b0 == 0x00 && b1 == 0x00 && b2 == 0xFE && b3 == 0xFF) + return 12001; // UTF-32BE + if (b0 == 0xFF && b1 == 0xFE && b2 == 0x00 && b3 == 0x00) + return 12000; // UTF-32LE + // // There is no unicode preamble, so we // return denoter for the machine default. @@ -495,7 +473,150 @@ namespace QUT.GplexBuffers stream.Seek(0, SeekOrigin.Begin); return 0; } -#endif // !BYTEMODE + + private static Encoding GuessEncoding(Stream stream) + { + stream.Seek(0, SeekOrigin.Begin); + if (IsUtf16(stream, out Encoding encoding)) + { + stream.Seek(0, SeekOrigin.Begin); + return encoding; + } + + stream.Seek(0, SeekOrigin.Begin); + if (IsUtf8(stream)) + { + stream.Seek(0, SeekOrigin.Begin); + return Encoding.UTF8; + } + + stream.Seek(0, SeekOrigin.Begin); + if (IsAscii(stream)) + { + stream.Seek(0, SeekOrigin.Begin); + return Encoding.ASCII; + } + +#if !NET462_OR_GREATER + stream.Seek(0, SeekOrigin.Begin); + if (IsLatin1(stream)) + { + stream.Seek(0, SeekOrigin.Begin); + return Encoding.Latin1; + } +#endif + stream.Seek(0, SeekOrigin.Begin); + return Encoding.Default; + } + + private static bool IsUtf8(Stream stream) + { + int b; + while ((b = stream.ReadByte()) != -1) + { + if ((b & 0x80) == 0) // 0xxxxxxx + { + continue; + } + else if ((b & 0xE0) == 0xC0) // 110xxxxx 10xxxxxx + { + if (!IsValidUtf8ContinuationByte(stream)) return false; + } + else if ((b & 0xF0) == 0xE0) // 1110xxxx 10xxxxxx 10xxxxxx + { + if (!IsValidUtf8ContinuationByte(stream) || !IsValidUtf8ContinuationByte(stream)) return false; + } + else if ((b & 0xF8) == 0xF0) // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + { + if (!IsValidUtf8ContinuationByte(stream) || !IsValidUtf8ContinuationByte(stream) || !IsValidUtf8ContinuationByte(stream)) return false; + } + else + { + return false; + } + } + return true; + } + + private static bool IsValidUtf8ContinuationByte(Stream stream) + { + int b = stream.ReadByte(); + return b != -1 && (b & 0xC0) == 0x80; // 10xxxxxx + } + + private static bool IsUtf16(Stream stream, out Encoding encoding) + { + encoding = Encoding.Default; + + if (stream.Length >= 2) + { + // Read the first two bytes + int b0 = stream.ReadByte(); + int b1 = stream.ReadByte(); + + // Check for UTF-16 BOM (Byte Order Mark) + if (b0 == 0xFF && b1 == 0xFE) + { + encoding = Encoding.Unicode; + return true; // UTF-16LE + } + if (b0 == 0xFE && b1 == 0xFF) + { + encoding = Encoding.BigEndianUnicode; + return true; // UTF-16BE + } + + // Reset the stream position + stream.Seek(0, SeekOrigin.Begin); + + // Check for common UTF-16 patterns + byte[] buffer = new byte[2]; + while (stream.Read(buffer, 0, 2) == 2) + { + if (buffer[0] == 0x00 && buffer[1] != 0x00) + { + encoding = Encoding.BigEndianUnicode; + return true; // Likely UTF-16BE + } + if (buffer[0] != 0x00 && buffer[1] == 0x00) + { + encoding = Encoding.Unicode; + return true; // Likely UTF-16LE + } + } + } + + return false; + } + + private static bool IsAscii(Stream stream) + { + int b; + while ((b = stream.ReadByte()) != -1) + { + // Latin1 includes byte values from 0x00 to 0xFF + if (b > 0x7F) + { + return false; + } + } + return true; + } + + private static bool IsLatin1(Stream stream) + { + int b; + while ((b = stream.ReadByte()) != -1) + { + // Latin1 includes byte values from 0x00 to 0xFF + if (b > 0xFF) + { + return false; + } + } + return true; + } + } #endif // !NOFILES #endregion Buffer classes @@ -540,180 +661,6 @@ namespace QUT.GplexBuffers return 0; } } -#region guesser -#if (!BYTEMODE) - // ============================================================== - // ============ Encoding Guesser ============= - // ============================================================== - - /// - /// This class provides a simple finite state automaton that - /// scans the file looking for (1) valid UTF-8 byte patterns, - /// (2) bytes >= 0x80 which are not part of a UTF-8 sequence. - /// The method then guesses whether it is UTF-8 or maybe some - /// local machine default encoding. This works well for the - /// various Latin encodings. - /// - internal class Guesser - { - ScanBuff buffer; - - public int GuessCodePage() { return Scan(); } - - const int maxAccept = 10; - const int initial = 0; - const int eofNum = 0; - const int goStart = -1; - const int INITIAL = 0; - const int EndToken = 0; - - #region user code - /* - * Reads the bytes of a file to determine if it is - * UTF-8 or a single-byte code page file. - */ - public long utfX; - public long uppr; - #endregion user code - - int state; - int currentStart = startState[0]; - int code; - - #region ScannerTables - static int[] startState = new int[] { 11, 0 }; - - #region CharacterMap - static sbyte[] map = new sbyte[256] { -/* '\0' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* '\x10' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* '\x20' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* '0' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* '@' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 'P' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* '`' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* '\x80' */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -/* '\x90' */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -/* '\xA0' */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -/* '\xB0' */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -/* '\xC0' */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* '\xD0' */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/* '\xE0' */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -/* '\xF0' */ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 }; - #endregion - - static sbyte[][] nextState = new sbyte[][] { - new sbyte[] {0, 0, 0, 0, 0, 0}, - new sbyte[] {-1, -1, 10, -1, -1, -1}, - new sbyte[] {-1, -1, -1, -1, -1, -1}, - new sbyte[] {-1, -1, 8, -1, -1, -1}, - new sbyte[] {-1, -1, 5, -1, -1, -1}, - new sbyte[] {-1, -1, 6, -1, -1, -1}, - new sbyte[] {-1, -1, 7, -1, -1, -1}, - null, - new sbyte[] {-1, -1, 9, -1, -1, -1}, - null, - null, - new sbyte[] {-1, 1, 2, 3, 4, 2} - }; - - - [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] - // Reason for suppression: cannot have self-reference in array initializer. - static Guesser() - { - nextState[7] = nextState[2]; - nextState[9] = nextState[2]; - nextState[10] = nextState[2]; - } - - int NextState() - { - if (code == ScanBuff.EndOfFile) - return eofNum; - else - return nextState[state][map[code]]; - } - #endregion - - public Guesser(System.IO.Stream file) { SetSource(file); } - - public void SetSource(System.IO.Stream source) - { - this.buffer = new BuildBuffer(source); - code = buffer.Read(); - } - - int Scan() - { - for (; ; ) - { - int next; - state = currentStart; - while ((next = NextState()) == goStart) - code = buffer.Read(); - - state = next; - code = buffer.Read(); - - while ((next = NextState()) > eofNum) - { - state = next; - code = buffer.Read(); - } - if (state <= maxAccept) - { - #region ActionSwitch -#pragma warning disable 162 - switch (state) - { - case eofNum: - switch (currentStart) - { - case 11: - if (utfX == 0 && uppr == 0) return -1; /* raw ascii */ - else if (uppr * 10 > utfX) return 0; /* default code page */ - else return 65001; /* UTF-8 encoding */ - break; - } - return EndToken; - case 1: // Recognized '{Upper128}', Shortest string "\xC0" - case 2: // Recognized '{Upper128}', Shortest string "\x80" - case 3: // Recognized '{Upper128}', Shortest string "\xE0" - case 4: // Recognized '{Upper128}', Shortest string "\xF0" - uppr++; - break; - case 5: // Recognized '{Utf8pfx4}{Utf8cont}', Shortest string "\xF0\x80" - uppr += 2; - break; - case 6: // Recognized '{Utf8pfx4}{Utf8cont}{2}', Shortest string "\xF0\x80\x80" - uppr += 3; - break; - case 7: // Recognized '{Utf8pfx4}{Utf8cont}{3}', Shortest string "\xF0\x80\x80\x80" - utfX += 3; - break; - case 8: // Recognized '{Utf8pfx3}{Utf8cont}', Shortest string "\xE0\x80" - uppr += 2; - break; - case 9: // Recognized '{Utf8pfx3}{Utf8cont}{2}', Shortest string "\xE0\x80\x80" - utfX += 2; - break; - case 10: // Recognized '{Utf8pfx2}{Utf8cont}', Shortest string "\xC0\x80" - utfX++; - break; - default: - break; - } -#pragma warning restore 162 - #endregion - } - } - } - } // end class Guesser - -#endif // !BYTEMODE -#endregion #endif // !NOFILES // End of code copied from embedded resource diff --git a/src/DataStreamSuite/Bts.ColumnExpressions/Bts.ColumnExpressions.csproj b/src/DataStreamSuite/Bts.ColumnExpressions/Bts.ColumnExpressions.csproj index 3c12da7d5..39adf039f 100644 --- a/src/DataStreamSuite/Bts.ColumnExpressions/Bts.ColumnExpressions.csproj +++ b/src/DataStreamSuite/Bts.ColumnExpressions/Bts.ColumnExpressions.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/Bts.ColumnSortExpressions/Bts.ColumnSortExpressions.csproj b/src/DataStreamSuite/Bts.ColumnSortExpressions/Bts.ColumnSortExpressions.csproj index b8d537b2f..0702bb4d2 100644 --- a/src/DataStreamSuite/Bts.ColumnSortExpressions/Bts.ColumnSortExpressions.csproj +++ b/src/DataStreamSuite/Bts.ColumnSortExpressions/Bts.ColumnSortExpressions.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/ColumnMapExpressions/ColumnMapExpressions.csproj b/src/DataStreamSuite/ColumnMapExpressions/ColumnMapExpressions.csproj index 27f40f3e1..3de47aebf 100644 --- a/src/DataStreamSuite/ColumnMapExpressions/ColumnMapExpressions.csproj +++ b/src/DataStreamSuite/ColumnMapExpressions/ColumnMapExpressions.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/DataStream/DataStream.csproj b/src/DataStreamSuite/DataStream/DataStream.csproj index 3a2d9153c..479db56f5 100644 --- a/src/DataStreamSuite/DataStream/DataStream.csproj +++ b/src/DataStreamSuite/DataStream/DataStream.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/src/DataStreamSuite/DataStreamCore/DataStreamCore.csproj b/src/DataStreamSuite/DataStreamCore/DataStreamCore.csproj index ee49dfc6f..0fe587cc4 100644 --- a/src/DataStreamSuite/DataStreamCore/DataStreamCore.csproj +++ b/src/DataStreamSuite/DataStreamCore/DataStreamCore.csproj @@ -2,7 +2,7 @@ true - net7.0 + net8.0 disable diff --git a/src/DataStreamSuite/DataStreamExpressions/DataStreamExpressions.csproj b/src/DataStreamSuite/DataStreamExpressions/DataStreamExpressions.csproj index bd9cded30..33646304f 100644 --- a/src/DataStreamSuite/DataStreamExpressions/DataStreamExpressions.csproj +++ b/src/DataStreamSuite/DataStreamExpressions/DataStreamExpressions.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj b/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj index 22308aee5..179d1c62e 100644 --- a/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj +++ b/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 enable true diff --git a/src/DataStreamSuite/DataStreamQueryAnalyzer/DataStreamQueryAnalyzer.csproj b/src/DataStreamSuite/DataStreamQueryAnalyzer/DataStreamQueryAnalyzer.csproj index f0a6a72da..44579304e 100644 --- a/src/DataStreamSuite/DataStreamQueryAnalyzer/DataStreamQueryAnalyzer.csproj +++ b/src/DataStreamSuite/DataStreamQueryAnalyzer/DataStreamQueryAnalyzer.csproj @@ -2,7 +2,7 @@ Exe - net7.0-windows + net8.0-windows enable true diff --git a/src/DataStreamSuite/DataStreamTests/DataStreamTests.csproj b/src/DataStreamSuite/DataStreamTests/DataStreamTests.csproj index 4f26bebcd..809c3e1de 100644 --- a/src/DataStreamSuite/DataStreamTests/DataStreamTests.csproj +++ b/src/DataStreamSuite/DataStreamTests/DataStreamTests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/ExpressionCore/ExpressionCore.csproj b/src/DataStreamSuite/ExpressionCore/ExpressionCore.csproj index cfadb03dd..30402ac0e 100644 --- a/src/DataStreamSuite/ExpressionCore/ExpressionCore.csproj +++ b/src/DataStreamSuite/ExpressionCore/ExpressionCore.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/DataStreamSuite/GuiUtilities/GuiUtilities.csproj b/src/DataStreamSuite/GuiUtilities/GuiUtilities.csproj index 01dc70830..2092e037c 100644 --- a/src/DataStreamSuite/GuiUtilities/GuiUtilities.csproj +++ b/src/DataStreamSuite/GuiUtilities/GuiUtilities.csproj @@ -1,7 +1,7 @@ - net7.0-windows + net8.0-windows enable enable true diff --git a/src/DataStreamSuite/PubSub/Client/PublishingUtilities/IPublisher.cs b/src/DataStreamSuite/PubSub/Client/PublishingUtilities/IPublisher.cs index 3f9e1a775..06397b335 100644 --- a/src/DataStreamSuite/PubSub/Client/PublishingUtilities/IPublisher.cs +++ b/src/DataStreamSuite/PubSub/Client/PublishingUtilities/IPublisher.cs @@ -6,12 +6,18 @@ namespace BCG public interface IPublisher { void publish( IPubItem pi ); +#pragma warning disable SYSLIB0011 // Type or member is obsolete void publish( IPubItem pi, IFormatter f ); +#pragma warning restore SYSLIB0011 // Type or member is obsolete void publish( IPubItem[] pi ); +#pragma warning disable SYSLIB0011 // Type or member is obsolete void publish( IPubItem[] pi, IFormatter f ); +#pragma warning restore SYSLIB0011 // Type or member is obsolete } +#pragma warning disable SYSLIB0011 // Type or member is obsolete public interface IPublisher where T : IFormatter +#pragma warning restore SYSLIB0011 // Type or member is obsolete { void publish (IPubItem pi); void publish (IPubItem[] pi); diff --git a/src/DataStreamSuite/PubSub/Misc/GenericFormatter.cs b/src/DataStreamSuite/PubSub/Misc/GenericFormatter.cs index 948e5765d..60b003d3f 100644 --- a/src/DataStreamSuite/PubSub/Misc/GenericFormatter.cs +++ b/src/DataStreamSuite/PubSub/Misc/GenericFormatter.cs @@ -5,23 +5,21 @@ using System.Runtime.Serialization.Formatters.Binary; namespace BCG { +#pragma warning disable SYSLIB0011 // Type or member is obsolete public class GenericFormatter : IGenericFormatter where F : IFormatter, new () { IFormatter myFormatter = new F (); public T Deserialize (Stream serializationStream) { - #pragma warning disable return (T) myFormatter.Deserialize (serializationStream); - #pragma warning restore SYSLIB0011 } public void Serialize (Stream serializationStream, T graph) { - #pragma warning disable myFormatter.Serialize (serializationStream, graph); - #pragma warning restore SYSLIB0011 } } public class GenericBinaryFormatter : GenericFormatter { } +#pragma warning restore SYSLIB0011 // Type or member is obsolete } diff --git a/src/DataStreamSuite/PubSub/PubSub.csproj b/src/DataStreamSuite/PubSub/PubSub.csproj index 772f6fb9a..c98ff358b 100644 --- a/src/DataStreamSuite/PubSub/PubSub.csproj +++ b/src/DataStreamSuite/PubSub/PubSub.csproj @@ -6,7 +6,7 @@ true - net7.0 + net8.0 enable diff --git a/src/DataStreamSuite/PubSubServer/PubSubServer.csproj b/src/DataStreamSuite/PubSubServer/PubSubServer.csproj index e5c310564..666dd989e 100644 --- a/src/DataStreamSuite/PubSubServer/PubSubServer.csproj +++ b/src/DataStreamSuite/PubSubServer/PubSubServer.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 enable diff --git a/src/DataStreamSuite/SharedStreams/SharedStreams.csproj b/src/DataStreamSuite/SharedStreams/SharedStreams.csproj index 233b5b976..ca7208d2f 100644 --- a/src/DataStreamSuite/SharedStreams/SharedStreams.csproj +++ b/src/DataStreamSuite/SharedStreams/SharedStreams.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/Spark.Admin.WebApp/src/Spark.Admin.WebApp.fsproj b/src/Spark.Admin.WebApp/src/Spark.Admin.WebApp.fsproj index b1786e5c0..bc11af435 100644 --- a/src/Spark.Admin.WebApp/src/Spark.Admin.WebApp.fsproj +++ b/src/Spark.Admin.WebApp/src/Spark.Admin.WebApp.fsproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 1.0.0 1.0.0 diff --git a/src/client/Spark.Console/Spark.Console.csproj b/src/client/Spark.Console/Spark.Console.csproj index 55a4c1712..e9d837364 100644 --- a/src/client/Spark.Console/Spark.Console.csproj +++ b/src/client/Spark.Console/Spark.Console.csproj @@ -2,9 +2,8 @@ Exe - net7.0 + net8.0 enable - win10-x64;ubuntu.16.04-x64 Blue Trading Systems Blue Trading Systems Spark diff --git a/src/client/spark/Spark.csproj b/src/client/spark/Spark.csproj index 479ed7763..782d9e0fa 100644 --- a/src/client/spark/Spark.csproj +++ b/src/client/spark/Spark.csproj @@ -1,7 +1,7 @@ - net7.0-windows + net8.0-windows true Blue Trading Systems Blue Trading Systems @@ -11,7 +11,6 @@ true Debug;Release x64 - win10-x64 x64 C:/Program Files/Microsoft Visual Studio/2022/Community/Msbuild/Current/Bin/amd64/Microsoft.CSharp.targets diff --git a/src/client/spark_api/spark_api.csproj b/src/client/spark_api/spark_api.csproj index f31b77ff7..e19a9ddd1 100644 --- a/src/client/spark_api/spark_api.csproj +++ b/src/client/spark_api/spark_api.csproj @@ -1,6 +1,6 @@ - net7.0 + net8.0 Blue Trading Systems Blue Trading Systems diff --git a/src/client/spark_api_server/spark_api_server.csproj b/src/client/spark_api_server/spark_api_server.csproj index bfed2c6db..4d0df7247 100644 --- a/src/client/spark_api_server/spark_api_server.csproj +++ b/src/client/spark_api_server/spark_api_server.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 enable x64 x64 diff --git a/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs b/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs index 7598bdc20..862898763 100644 --- a/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs +++ b/src/client/spark_core/Collections/Extensions/DictionaryExtensions.cs @@ -213,9 +213,6 @@ namespace System.Collections.Generic { ); } - public static Dictionary ToDictionary(this IEnumerable<(T1, T2)> source) => - source.ToDictionary(tup => tup.Item1, tup => tup.Item2); - /// /// Gets the value associated with the specified key, then removes the key if the lookup was successful. /// diff --git a/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs b/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs index 0ac6def0e..87cb5a520 100644 --- a/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs +++ b/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs @@ -655,13 +655,6 @@ namespace System.Collections.Generic { public static IReadOnlyList ToReadOnlyList(this IEnumerable enumerable) => enumerable.ToList(); - public static Dictionary ToDictionary(this IEnumerable> key_values) - where TKey : notnull => - key_values.ToDictionary(kv => kv.Key, kv => kv.Value); - - public static Dictionary ToDictionary(this IEnumerable> key_values, IEqualityComparer comparer) where TKey : notnull => - key_values.ToDictionary(kv => kv.Key, kv => kv.Value, comparer); - public static Dictionary ToDictionaryCrushed(this IEnumerable source, Func key_selector) where TKey : notnull { var rv = new Dictionary(); foreach (T v in source) diff --git a/src/client/spark_core/spark_core.csproj b/src/client/spark_core/spark_core.csproj index 1052d7475..24829ec0a 100644 --- a/src/client/spark_core/spark_core.csproj +++ b/src/client/spark_core/spark_core.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 true x64 x64 diff --git a/src/client/spark_sdk/spark_sdk.csproj b/src/client/spark_sdk/spark_sdk.csproj index c6699b6f6..db70d3dd6 100644 --- a/src/client/spark_sdk/spark_sdk.csproj +++ b/src/client/spark_sdk/spark_sdk.csproj @@ -1,9 +1,9 @@  - net7.0 + net8.0 Exe true - $(OutputPath)\net7.0 + $(OutputPath)\net8.0 true true $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage @@ -43,19 +43,19 @@ - + - - + + - ..\..\lib\net7.0\spark_api.dll + ..\..\lib\net8.0\spark_api.dll - + diff --git a/src/client/spark_test/spark_test.csproj b/src/client/spark_test/spark_test.csproj index 3e94cb08b..e6fd32389 100644 --- a/src/client/spark_test/spark_test.csproj +++ b/src/client/spark_test/spark_test.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 x64 x64 diff --git a/src/client/spark_websocket/spark_websocket.csproj b/src/client/spark_websocket/spark_websocket.csproj index 6477ee98a..394a20b6e 100644 --- a/src/client/spark_websocket/spark_websocket.csproj +++ b/src/client/spark_websocket/spark_websocket.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable x64 x64 diff --git a/tools/spark.cmd b/tools/spark.cmd index 810046b7d..21c6948c7 100644 --- a/tools/spark.cmd +++ b/tools/spark.cmd @@ -29,4 +29,4 @@ shift goto exe_args_loop :launch_spark -%REPO_DIR%\build\%BUILD_TYPE%\bin\net7.0-windows\Spark.exe %SPARK_EXE_ARGS% +%REPO_DIR%\build\%BUILD_TYPE%\bin\net8.0-windows\Spark.exe %SPARK_EXE_ARGS% diff --git a/tools/spark.console.cmd b/tools/spark.console.cmd index 27b72927e..f392d11e3 100644 --- a/tools/spark.console.cmd +++ b/tools/spark.console.cmd @@ -30,4 +30,4 @@ shift goto exe_args_loop :launch_spark_console -%REPO_DIR%\build\%BUILD_TYPE%\bin\net7.0\Spark.Console.exe %SPARK_CONSOLE_EXE_ARGS% +%REPO_DIR%\build\%BUILD_TYPE%\bin\net8.0\Spark.Console.exe %SPARK_CONSOLE_EXE_ARGS%