-
Notifications
You must be signed in to change notification settings - Fork 1k
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
support file path to base64 in parse #3487
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,17 @@ private void OnParseCommand(string value) | |
} | ||
} | ||
|
||
/// <summary> | ||
/// Read .nef file from path and print its content in base64 | ||
/// </summary> | ||
[ParseFunction(".nef file path to content base64")] | ||
private string? NefPathToContentBase64(string path) | ||
{ | ||
if (Path.GetExtension(path).ToLower() != ".nef") return null; | ||
if (!File.Exists(path)) return null; | ||
return Convert.ToBase64String(File.ReadAllBytes(path)); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest, I don't think we need this command for CLI because it's always possible to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. windows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's also possible but the command is a bit longer. |
||
|
||
/// <summary> | ||
/// Little-endian to Big-endian | ||
/// input: ce616f7f74617e0fc4b805583af2602a238df63f | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it allow only
nef
file extensions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done