-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from Petteroe/feature/add-stream-response
Feature/add stream response
- Loading branch information
Showing
7 changed files
with
198 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
namespace Weasyprint.Wrapped; | ||
|
||
public abstract class PrintBaseResult | ||
{ | ||
public PrintBaseResult(string error, TimeSpan runTime, int exitCode) | ||
{ | ||
this.Error = error; | ||
this.RunTime = runTime; | ||
this.ExitCode = exitCode; | ||
} | ||
|
||
public bool HasError => !string.IsNullOrWhiteSpace(Error); | ||
|
||
public string Error { get; } | ||
public TimeSpan RunTime { get; } | ||
public int ExitCode { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
|
||
namespace Weasyprint.Wrapped; | ||
|
||
public class PrintResult | ||
public class PrintResult : PrintBaseResult | ||
{ | ||
public PrintResult(byte[] bytes, string error, TimeSpan runTime, int exitCode) | ||
: base(error, runTime, exitCode) | ||
{ | ||
this.Bytes = bytes; | ||
this.Error = error; | ||
this.RunTime = runTime; | ||
this.ExitCode = exitCode; | ||
} | ||
|
||
public bool HasError => !string.IsNullOrWhiteSpace(Error); | ||
|
||
public byte[] Bytes { get; } | ||
public string Error { get; } | ||
public TimeSpan RunTime { get; } | ||
public int ExitCode { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
namespace Weasyprint.Wrapped; | ||
|
||
public class PrintStreamResult : PrintBaseResult | ||
{ | ||
public PrintStreamResult(Stream documentDocumentStream, string error, TimeSpan runTime, int exitCode) | ||
: base(error, runTime, exitCode) | ||
{ | ||
this.DocumentStream = documentDocumentStream; | ||
} | ||
|
||
public Stream DocumentStream { get; } | ||
} |
Oops, something went wrong.