Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Enhace debugging view #209

Merged
merged 1 commit into from Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Yarhl/FileSystem/Node.cs
Expand Up @@ -21,12 +21,14 @@ namespace Yarhl.FileSystem
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Yarhl.FileFormat;
using Yarhl.IO;

/// <summary>
/// Node in the FileSystem with an associated format.
/// </summary>
[DebuggerDisplay("{Name} [{Format}]")]
public partial class Node : NavigableNode<Node>
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Yarhl/FileSystem/NodeContainerFormat.cs
Expand Up @@ -20,12 +20,14 @@
namespace Yarhl.FileSystem
{
using System;
using System.Diagnostics;
using System.Linq;
using Yarhl.FileFormat;

/// <summary>
/// Node container format for unpack / pack files.
/// </summary>
[DebuggerDisplay("Container: count={Root.Children.Count}")]
public class NodeContainerFormat : IDisposable, ICloneableFormat
{
bool manageRoot;
Expand Down
2 changes: 2 additions & 0 deletions src/Yarhl/IO/BinaryFormat.cs
Expand Up @@ -20,12 +20,14 @@
namespace Yarhl.IO
{
using System;
using System.Diagnostics;
using System.IO;
using Yarhl.FileFormat;

/// <summary>
/// Binary format.
/// </summary>
[DebuggerDisplay("Binary: {Stream}")]
public class BinaryFormat : IBinary, IDisposable, ICloneableFormat
{
/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion src/Yarhl/IO/DataStream.cs
Expand Up @@ -23,10 +23,10 @@ namespace Yarhl.IO
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using Yarhl.FileFormat;
using Yarhl.IO.StreamFormat;

/// <summary>
Expand All @@ -43,6 +43,10 @@ namespace Yarhl.IO
"",
"S3881",
Justification = "Historical reasons: https://docs.microsoft.com/en-us/dotnet/api/system.io.stream.dispose")]
[DebuggerDisplay(
"pos={\"0x\" + Position.ToString(\"X\")}, " +
"len={\"0x\" + Length.ToString(\"X\")}, " +
"offset={\"0x\" + Offset.ToString(\"X\")}")]
public partial class DataStream : Stream
{
static readonly ConcurrentDictionary<Stream, StreamInfo> Instances = new ConcurrentDictionary<Stream, StreamInfo>();
Expand Down