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

'using' in FS.h #2030

Closed
BuzzBurrowes opened this issue May 14, 2016 · 1 comment
Closed

'using' in FS.h #2030

BuzzBurrowes opened this issue May 14, 2016 · 1 comment

Comments

@BuzzBurrowes
Copy link
Contributor

BuzzBurrowes commented May 14, 2016

Awesome that the classes in FS.h are in a namespace. Nice. But...

The 'usings' at the bottom of the file are no good...

using fs::FS;
using fs::File;
using fs::Dir;
using fs::SeekMode;
using fs::SeekSet;
using fs::SeekCur;
using fs::SeekEnd;
using fs::FSInfo;

I get the idea... by doing this, you can easily take code that was using the Sd Library and substitute SPIFFS.

BUT... if you need to use both, which I do, then I need to comment out those usings... which leads to a code maintenance issues with library updates.

I would propose something like the following...

#ifndef _NO_FS_USINGS
using fs::FS;
using fs::File;
using fs::Dir;
using fs::SeekMode;
using fs::SeekSet;
using fs::SeekCur;
using fs::SeekEnd;
using fs::FSInfo;
#endif

Then current functionality is maintained, and I can just modify my project's build settings to get what I need. Well, at least I am going to try that on my branch.

  • Buzz

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

igrr added a commit that referenced this issue May 16, 2016
Putting `#define FS_NO_GLOBALS` before `#include <FS.h>` will disable `using` declarations for FS classes.
@igrr
Copy link
Member

igrr commented May 16, 2016

Added FS_NO_GLOBALS.

@igrr igrr added this to the 2.3.0 milestone May 16, 2016
@igrr igrr closed this as completed Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants