Skip to content

Commit

Permalink
Remove basenameAndExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mgenware committed Jan 26, 2024
1 parent 7d0d966 commit 519b08e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.0

- Remove `basenameAndExtensions`.

## 1.0.0

- Initial version.
27 changes: 0 additions & 27 deletions lib/src/fc_path_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@ import 'package:path/path.dart' as p;
Set<String> _ignoredFiles = {'.DS_Store', 'Thumbs.db'};
Set<String> _ignoredFolders = {'\$RECYCLE.BIN', 'System Volume Information'};

class FCPathNameAndExtensions {
final String name;
final String extensions;

FCPathNameAndExtensions(this.name, this.extensions);

@override
String toString() {
var s = name;
if (extensions.isNotEmpty) {
s += '[$extensions]';
}
return s;
}
}

class FCPathUtil {
/// Checks if the given file name is considered a hidden file.
/// If [dotFiles] is true, file names starting with a dot(.) are considered hidden.
Expand All @@ -39,15 +23,4 @@ class FCPathUtil {
}
return path;
}

/// Returns the basename and extensions of a given [path].
static FCPathNameAndExtensions basenameAndExtensions(String path) {
var bn = p.basename(path);
var idx = bn.indexOf('.');
if (idx < 0) {
return FCPathNameAndExtensions(bn, '');
}
return FCPathNameAndExtensions(
idx == 0 ? '' : bn.substring(0, idx), bn.substring(idx));
}
}

0 comments on commit 519b08e

Please sign in to comment.