-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acd9126
commit 83dbbef
Showing
14 changed files
with
85 additions
and
111 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
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,23 +1,14 @@ | ||
import 'dart:io' show File; | ||
|
||
import 'package:flutter/foundation.dart'; | ||
import 'package:path/path.dart' as path; | ||
|
||
import 'file_system_entity_extensions.dart'; | ||
|
||
/// Set of extensions on [File] type. | ||
extension FileExtensions on File { | ||
/// Calls [path.extension] on this [File]. | ||
String get extension => path.extension(this.path); | ||
|
||
/// Calls [path.basename] on this [File]. | ||
String get basename => path.basename(this.path); | ||
|
||
/// Calls [path.basenameWithoutExtension] on this [File]. | ||
String get basenameWithoutExtension => | ||
path.basenameWithoutExtension(this.path); | ||
|
||
/// Returns redacted file info usable for logging. | ||
/// | ||
/// In case of [kDebugMode], full [File.path] is returned; | ||
/// "???.[FileExtensions.extension]" otherwise. | ||
String get redactedInfo => (kDebugMode ? this.path : "???$extension"); | ||
String get redactedInfo => (kDebugMode ? path : "???$extension"); | ||
} |
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,23 @@ | ||
import 'dart:io' show FileSystemEntity; | ||
|
||
import 'package:path/path.dart' as path; | ||
|
||
import 'directory_extensions.dart'; | ||
import 'file_extensions.dart'; | ||
|
||
/// Set of extensions on [FileSystemEntity] type. | ||
/// | ||
/// See also: | ||
/// - [FileExtensions] | ||
/// - [DirectoryExtensions] | ||
extension FileSystemEntityExtensions on FileSystemEntity { | ||
/// Calls [path.extension] on this [FileSystemEntity.path]. | ||
String get extension => path.extension(this.path); | ||
|
||
/// Calls [path.basename] on this [FileSystemEntity.path]. | ||
String get basename => path.basename(this.path); | ||
|
||
/// Calls [path.basenameWithoutExtension] on this [FileSystemEntity.path]. | ||
String get basenameWithoutExtension => | ||
path.basenameWithoutExtension(this.path); | ||
} |
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
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
Oops, something went wrong.