| Index: pkg/path/lib/src/style/posix.dart
|
| diff --git a/pkg/path/lib/src/style/posix.dart b/pkg/path/lib/src/style/posix.dart
|
| index e0b601743c743b829aa817fc5721e3128cadb9a9..b8b82b406d33f31a08d5c4a05c67b86dbdbc4b2f 100644
|
| --- a/pkg/path/lib/src/style/posix.dart
|
| +++ b/pkg/path/lib/src/style/posix.dart
|
| @@ -4,6 +4,7 @@
|
|
|
| library path.style.posix;
|
|
|
| +import '../characters.dart' as chars;
|
| import '../parsed_path.dart';
|
| import '../internal_style.dart';
|
|
|
| @@ -13,9 +14,28 @@ class PosixStyle extends InternalStyle {
|
|
|
| final name = 'posix';
|
| final separator = '/';
|
| + final separators = const ['/'];
|
| +
|
| + // Deprecated properties.
|
| +
|
| final separatorPattern = new RegExp(r'/');
|
| final needsSeparatorPattern = new RegExp(r'[^/]$');
|
| final rootPattern = new RegExp(r'^/');
|
| + final relativeRootPattern = null;
|
| +
|
| + bool containsSeparator(String path) => path.contains('/');
|
| +
|
| + bool isSeparator(int codeUnit) => codeUnit == chars.SLASH;
|
| +
|
| + bool needsSeparator(String path) =>
|
| + path.isNotEmpty && !isSeparator(path.codeUnitAt(path.length - 1));
|
| +
|
| + String getRoot(String path) {
|
| + if (path.isNotEmpty && isSeparator(path.codeUnitAt(0))) return '/';
|
| + return null;
|
| + }
|
| +
|
| + String getRelativeRoot(String path) => null;
|
|
|
| String pathFromUri(Uri uri) {
|
| if (uri.scheme == '' || uri.scheme == 'file') {
|
|
|