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

Add support for System.IO.Directory #1883

Merged
merged 23 commits into from
Apr 22, 2021

Conversation

morali
Copy link
Contributor

@morali morali commented Apr 16, 2021

Description

  • Implements native support for Directory API for System.IO.FileSystem.

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (work on Unit Tests, has no impact on code or features)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Automated fixes for code style.
@nfbot
Copy link
Member

nfbot commented Apr 16, 2021

@morali there are issues with the code style on the source files.
A PR was submitted with the code style fixes. Please review and merge the changes. See morali#4.

Make sure you are using the project code style. Check the details here.

morali and others added 4 commits April 16, 2021 14:28
@nfbot
Copy link
Member

nfbot commented Apr 16, 2021

@morali there are issues with the code style on the source files.
A PR was submitted with the code style fixes. Please review and merge the changes. See morali#5.

Make sure you are using the project code style. Check the details here.

morali and others added 3 commits April 16, 2021 15:11
…14f-84e5-4457-8779-9ff4efc29765

Code style fixes for nanoframework/nf-interpreter PR#1883
@josesimoes josesimoes marked this pull request as draft April 18, 2021 13:01
@nfbot
Copy link
Member

nfbot commented Apr 21, 2021

@morali there are issues with the code style on the source files.
A PR was submitted with the code style fixes. Please review and merge the changes. See morali#6.

Make sure you are using the project code style. Check the details here.

@morali morali changed the title WIP: System IO Directory class System IO Directory class Apr 21, 2021
@morali morali marked this pull request as ready for review April 21, 2021 11:03
Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good. Just replace those exception throwers and we are good.

Nicely done! 👍🏻


bool exists = false;
FRESULT operationResult;
FAULT_ON_NULL(folderPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be FAULT_ON_NULL_ARG which will throw the ArgumentNull exception.
This one is for NullReference, which is not the intended exception.

NANOCLR_HEADER();
{
const char *filePathSrc = stack.Arg0().RecoverString();
FAULT_ON_NULL(filePathSrc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

const char *filePathSrc = stack.Arg0().RecoverString();
FAULT_ON_NULL(filePathSrc);
const char *filePathDest = stack.Arg1().RecoverString();
FAULT_ON_NULL(filePathDest);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

NANOCLR_HEADER();
{
const char *folderPath = stack.Arg0().RecoverString();
FAULT_ON_NULL(folderPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

NANOCLR_HEADER();
{
const char *folderPath = stack.Arg0().RecoverString();
FAULT_ON_NULL(folderPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

FRESULT operationResult;
static FILINFO fileInfo;

FAULT_ON_NULL(folderPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

FRESULT operationResult;
static FILINFO fileInfo;

FAULT_ON_NULL(folderPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

FILINFO fileInfo;

const char *folderPath = stack.Arg0().RecoverString();
FAULT_ON_NULL(folderPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@morali
Copy link
Contributor Author

morali commented Apr 22, 2021

Overall looking good. Just replace those exception throwers and we are good.

Nicely done! 👍🏻

Thank you, the exceptions throwers were replaced.

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@josesimoes josesimoes changed the title System IO Directory class Add support for System.IO.Directory Apr 22, 2021
@josesimoes josesimoes added the Area: Common libs Everything related with common libraries label Apr 22, 2021
@josesimoes josesimoes merged commit c4b423c into nanoframework:develop Apr 22, 2021
josesimoes pushed a commit that referenced this pull request May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common libs Everything related with common libraries Type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants