tenon library

Classes

AnsiColor
ANSI颜色和样式控制类,用于控制台输出的丰富格式化
AsyncLogStrategy
异步日志策略
BoolList
A space-efficient list of boolean values.
ByteDataReader
A class for parsing byte arrays.
ByteDataWriter
A class for building byte arrays with a BytesBuffer and a fixed-length work buffer.
BytesBuffer
A class for concatenating byte arrays efficiently.
CanonicalizedMap<C, K, V>
A map whose keys are converted to canonical values of type C.
CaseInsensitiveEquality
String equality that's insensitive to differences in ASCII case.
CombinedIterableView<T>
A view of several iterables combined sequentially into a single iterable.
CombinedListView<T>
A view of several lists combined into a single list.
CombinedMapView<K, V>
Returns a new map that represents maps flattened into a single map.
ConsoleStrategy
Context
An instantiable class for manipulating paths. Unlike the top-level functions, this lets you explicitly select what platform the paths will use.
Crc16
An alias of Crc16Arc.
Crc16A
An alias of Crc16IsoIec144433A.
Crc16Acorn
An alias of Crc16Xmodem.
Crc16Arc
Crc16AugCcitt
An alias of Crc16SpiFujitsu.
Crc16Autosar
An alias of Crc16Ibm3740.
Crc16B
An alias of Crc16IbmSdlc.
Crc16Buypass
An alias of Crc16Umts.
Crc16Ccitt
An alias of Crc16Kermit.
Crc16CcittFalse
An alias of Crc16Ibm3740.
Crc16CcittTrue
An alias of Crc16Kermit.
Crc16Cdma2000
Crc16Cms
Crc16Darc
An alias of Crc16GeniBus.
Crc16Dds110
Crc16DectR
Crc16DectX
Crc16Dnp
Crc16En13757
Crc16Epc
An alias of Crc16GeniBus.
Crc16EpcC1g2
An alias of Crc16GeniBus.
Crc16GeniBus
Crc16Gsm
Crc16Ibm
An alias of Crc16Arc.
Crc16Ibm3740
Crc16IbmSdlc
Crc16ICode
An alias of Crc16GeniBus.
Crc16Iec611582
An alias of Crc16Profibus.
Crc16IsoHdlc
An alias of Crc16IbmSdlc.
Crc16IsoIec144433A
Crc16IsoIec144433B
An alias of Crc16IbmSdlc.
Crc16Kermit
Crc16Lha
An alias of Crc16Arc.
Crc16LJ1200
Crc16Lte
An alias of Crc16Xmodem.
Crc16Maxim
An alias of Crc16MaximDow.
Crc16MaximDow
Crc16Mcrf4xx
Crc16Modbus
Crc16Nrsc5
Crc16OpenSafetyA
Crc16OpenSafetyB
Crc16Profibus
Crc16R
An alias of Crc16DectR.
Crc16Riello
Crc16SpiFujitsu
Crc16T10Dif
Crc16Teledisk
Crc16Tms37157
Crc16Umts
Crc16Usb
Crc16V41Lsb
An alias of Crc16Kermit.
Crc16V41Msb
An alias of Crc16Xmodem.
Crc16Verifone
An alias of Crc16Umts.
Crc16X
An alias of Crc16DectX.
Crc16X25
An alias of Crc16IbmSdlc.
Crc16Xmodem
Crc16Zmodem
An alias of Crc16Xmodem.
Crc24
An alias of Crc24OpenPgp.
Crc24Ble
Crc24FlexRayA
Crc24FlexRayB
Crc24Interlaken
Crc24LteA
Crc24LteB
Crc24OpenPgp
Crc24Os9
Crc32
An alias of Crc32IsoHdlc.
Crc32Aal5
An alias of Crc32Bzip2.
Crc32Adccp
An alias of Crc32IsoHdlc.
Crc32Aixm
Crc32Autosar
Crc32B
An alias of Crc32Bzip2.
Crc32Base91C
An alias of Crc32Iscsi.
Crc32Base91D
Crc32Bzip2
Crc32C
An alias of Crc32Iscsi.
Crc32Castagnoli
An alias of Crc32Iscsi.
Crc32CDRomEdc
Crc32Cksum
Crc32D
An alias of Crc32Base91D.
Crc32DectB
An alias of Crc32Bzip2.
Crc32Interlaken
An alias of Crc32Iscsi.
Crc32Iscsi
Crc32IsoHdlc
Crc32JamCrc
Crc32Mpeg2
Crc32Pkzip
An alias of Crc32IsoHdlc.
Crc32Posix
An alias of Crc32Cksum.
Crc32Q
An alias of Crc32Aixm.
Crc32V42
An alias of Crc32IsoHdlc.
Crc32Xfer
Crc32Xz
An alias of Crc32IsoHdlc.
Crc40Gsm
Crc64
An alias of Crc64Ecma182.
Crc64Ecma182
Crc64GoEcma
An alias of Crc64Xz.
Crc64GoIso
Crc64WE
Crc64Xz
Crc8
An alias of Crc8SMBus.
Crc8Aes
An alias of Crc8Tech3250.
Crc8Autosar
Crc8Bluetooth
Crc8Cdma2000
Crc8Darc
Crc8Dow
An alias of Crc8MaximDow.
Crc8DvbS2
Crc8Ebu
An alias of Crc8Tech3250.
Crc8GsmA
Crc8GsmB
Crc8I4321
Crc8ICode
Crc8Itu
An alias of Crc8I4321.
Crc8Lte
Crc8Maxim
An alias of Crc8MaximDow.
Crc8MaximDow
Crc8MifareMad
Crc8Nrsc5
Crc8OpenSafety
Crc8Rohc
Crc8SaeJ1850
Crc8SMBus
Crc8Tech3250
Crc8Wcdma
DateFormats
DeepCollectionEquality
Deep equality on collections.
DefaultEquality<E>
Equality of objects that compares only the natural equality of the objects.
DelegatingIterable<E>
An Iterable that delegates all operations to a base iterable.
DelegatingList<E>
A List that delegates all operations to a base list.
DelegatingMap<K, V>
A Map that delegates all operations to a base map.
DelegatingQueue<E>
A Queue that delegates all operations to a base queue.
DelegatingSet<E>
A Set that delegates all operations to a base set.
DeveloperStrategy
Equality<E>
A generic equality relation on objects.
EqualityBy<E, F>
Equality of objects based on derived values.
EqualityMap<K, V>
A Map whose key equality is determined by an Equality object.
EqualitySet<E>
A Set whose key equality is determined by an Equality object.
Equatable
A base class to facilitate operator == and hashCode overrides.
EquatableConfig
The default configuration for all Equatable instances.
HeapPriorityQueue<E>
Heap based priority queue.
IdentityEquality<E>
Equality of objects that compares only the identity of the objects.
IterableEquality<E>
Equality on iterables.
IterableZip<T>
Iterable that iterates over lists of values from other iterables.
ListEquality<E>
Equality on lists.
ListSlice<E>
A list view of a range of another list.
Lock
A mutual-exclusion lock: serializes access to a shared resource across asynchronous code, similar to Java's synchronized.
Logger
LogLevel
日志级别
LogRecord
LogStrategy
日志策略
LruMap<K, V>
MapEquality<K, V>
Equality on maps.
MapKeySet<E>
An unmodifiable Set view of the keys of a Map.
MapValueSet<K, V>
Creates a modifiable Set view of the values of a Map.
MultiEquality<E>
Combines several equalities into a single equality.
MultiLock
A Lock that atomically acquires several other locks together.
NonGrowableListMixin<E>
Mixin class that implements a throwing version of all list operations that change the List's length.
NonGrowableListView<E>
A fixed-length list.
PathMap<V>
A map whose keys are paths, compared using p.equals and p.hash.
PathSet
A set containing paths, compared using p.equals and p.hash.
PriorityQueue<E>
A priority queue is a priority based work-list of elements.
QueueList<E>
A class that efficiently implements both Queue and List.
SetEquality<E>
Equality of sets.
Style
An enum type describing a "flavor" of path.
UnionSet<E>
A single set that provides a view of the union over a set of sets.
UnionSetController<E>
A controller that exposes a view of the union of a collection of sets.
UnmodifiableListView<E>
An unmodifiable List view of another List.
UnmodifiableMapMixin<K, V>
Mixin class that implements a throwing version of all map operations that change the Map.
UnmodifiableMapView<K, V>
View of a Map that disallow modifying the map.
UnmodifiableSetMixin<E>
Mixin class that implements a throwing version of all set operations that change the Set.
UnmodifiableSetView<E>
An unmodifiable set.
UnorderedIterableEquality<E>
Equality of the elements of two iterables without considering order.
Uuid
uuid for Dart Author: Yulian Kuncheff Released under MIT License.
UuidValue

Enums

Namespace
RFC4122 & RFC9562 provided namespaces for v3, v5, and v8 namespace based UUIDs
ValidationMode
The options for UUID Validation strictness

Mixins

EquatableMixin
A mixin that helps implement equality without needing to explicitly override operator == and hashCode.
LogMixin

Extensions

ComparatorExtension on Comparator<T>
Extensions on comparator functions.
CryptoExt on String
DateTimeExt on DateTime
DateTimeForIntExt on int
DirectoryExt on Directory
DurationExt on int
FileExt on File
FileSizeExt on int
FileSystemEntityExt on FileSystemEntity
FunctionExt on Function
IntConvertExt on int
IterableComparableExtension on Iterable<T>
Extensions that apply to iterables of Comparable elements.
IterableDoubleExtension on Iterable<double>
Extension on iterables of double.
IterableExt on Iterable<T>
IterableExtension on Iterable<T>
Extensions that apply to all iterables.
IterableIntegerExtension on Iterable<int>
Extension on iterables of integers.
IterableIterableExtension on Iterable<Iterable<T>>
Extensions on iterables whose elements are also iterables.
IterableNullableExtension on Iterable<T?>
Extensions that apply to iterables with a nullable element type.
IterableNumberExtension on Iterable<num>
Extensions that apply to iterables of numbers.
ListComparableExtensions on List<E>
Various extensions on lists of comparable elements.
ListExt on List<T>
ListExtensions on List<E>
Various extensions on lists of arbitrary elements.
ListIntExt on List<int>
LogLevelExt on LogLevel
LogRecordExt on LogRecord
MapExt on Map<K, V>
NullableListExt on List<T>?
NullableMapExt on Map<K, V>?
NullStringExt on String?
NumExt on num
ObjectExt on Object?
ObjectOperatorExt on T
PathExt on String
PlatformExt on Platform
RegexExt on String
StringConvertExt on String
StringExt on String
TekartikLockExtension on Lock
Extension on Lock providing synchronous execution when possible, for synchronous computations that don't need to always go through a Future.
UuidExt on String

Properties

context Context
The system path context.
final
current String
Gets the path to the current working directory.
no setter
currentDateTime DateTime
当前日期
no setter
currentTimeStamp int
当前时间戳
no setter
posix Context
A default context for manipulating POSIX paths.
final
separator String
Gets the path separator for the current platform. This is \ on Windows and / on other platforms (including the browser).
no setter
style Style
Returns the Style of the current context.
no setter
url Context
A default context for manipulating URLs.
final
windows Context
A default context for manipulating Windows paths.
final

Functions

absolute(String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7, String? part8, String? part9, String? part10, String? part11, String? part12, String? part13, String? part14, String? part15]) String
Returns a new path with the given path parts appended to current.
basename(String path) String
Gets the part of path after the last separator.
basenameWithoutExtension(String path) String
Gets the part of path after the last separator, and without any trailing file extension.
binarySearch<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns a position of the value in sortedList, if it is there.
canonicalize(String path) String
Canonicalizes path.
castBytes(List<int> bytes, {bool copy = false}) Uint8List
Cast the list of bytes into a typed Uint8List.
compareAsciiLowerCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to lower case.
compareAsciiLowerCaseNatural(String a, String b) int
Compares strings a and b according to lower-case natural sort ordering.
compareAsciiUpperCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to upper case.
compareAsciiUpperCaseNatural(String a, String b) int
Compares strings a and b according to upper-case natural sort ordering.
compareNatural(String a, String b) int
Compares strings a and b according to natural sort ordering.
dirname(String path) String
Gets the part of path before the last separator.
equals(String path1, String path2) bool
Returns true if path1 points to the same location as path2, and false otherwise.
equalsIgnoreAsciiCase(String a, String b) bool
Checks if strings a and b differ only on the case of ASCII letters.
extension(String path, [int level = 1]) String
Gets the file extension of path: the portion of basename from the last . to the end (including the . itself).
fromUri(Object? uri) String
Returns the path represented by uri, which may be a String or a Uri.
groupBy<S, T>(Iterable<S> values, T key(S)) Map<T, List<S>>
Groups the elements in values by the value returned by key.
hash(String path) int
Returns a hash code for path such that, if equals returns true for two paths, their hash codes are the same.
hashIgnoreAsciiCase(String string) int
Hash code for a string which is compatible with equalsIgnoreAsciiCase.
insertionSort<E>(List<E> elements, {int compare(E, E)?, int start = 0, int? end}) → void
Sort a list between start (inclusive) and end (exclusive) using insertion sort.
isAbsolute(String path) bool
Returns true if path is an absolute path and false if it is a relative path.
isRelative(String path) bool
Returns true if path is a relative path and false if it is absolute. On POSIX systems, absolute paths start with a / (forward slash). On Windows, an absolute path starts with \\, or a drive letter followed by :/ or :\.
isRootRelative(String path) bool
Returns true if path is a root-relative path and false if it's not.
isWithin(String parent, String child) bool
Returns true if child is a path beneath parent, and false otherwise.
join(String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7, String? part8, String? part9, String? part10, String? part11, String? part12, String? part13, String? part14, String? part15, String? part16]) String
Joins the given path parts into a single path using the current platform's separator. Example:
joinAll(Iterable<String> parts) String
Joins the given path parts into a single path using the current platform's separator. Example:
lastBy<S, T>(Iterable<S> values, T key(S)) Map<T, S>
Associates the elements in values by the value returned by key.
lowerBound<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns the first position in sortedList that does not compare less than value.
mapMap<K1, V1, K2, V2>(Map<K1, V1> map, {K2 key(K1, V1)?, V2 value(K1, V1)?}) Map<K2, V2>
Creates a new map from map with new keys and values.
maxBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the maximum value.
mergeMaps<K, V>(Map<K, V> map1, Map<K, V> map2, {V value(V, V)?}) Map<K, V>
Returns a new map with all key/value pairs in both map1 and map2.
mergeSort<E>(List<E> elements, {int start = 0, int? end, int compare(E, E)?}) → void
Sorts a list between start (inclusive) and end (exclusive) using the merge sort algorithm.
minBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the minimum value.
normalize(String path) String
Normalizes path, simplifying it by handling .., and ., and removing redundant path separators whenever possible.
prettyUri(Object? uri) String
Returns a terse, human-readable representation of uri.
readAsBytes(Stream<List<int>> stream, {int? maxLength, bool copy = false}) Future<Uint8List>
Read stream into a typed byte buffer.
readAsString(Stream<List<int>> stream, {Encoding? encoding}) Future<String>
Read stream into a String.
relative(String path, {String? from}) String
Attempts to convert path to an equivalent relative path from the current directory.
reverse<E>(List<E> elements, [int start = 0, int? end]) → void
Reverses a list, or a part of a list, in-place.
rootPrefix(String path) String
Returns the root of path, if it's absolute, or the empty string if it's relative.
setExtension(String path, String extension) String
Returns path with the trailing extension set to extension.
shuffle(List elements, [int start = 0, int? end, Random? random]) → void
Shuffles a list randomly.
sliceStream(Stream<List<int>> stream, int sliceLength, {int? maxLength, bool copy = false}) Stream<Uint8List>
Read stream and slice the content into chunks with target/max length of sliceLength.
split(String path) List<String>
Splits path into its components using the current platform's separator.
stronglyConnectedComponents<T>(Map<T, Iterable<T>> graph) List<Set<T>>
Returns the strongly connected components of graph, in topological order.
toUri(String path) Uri
Returns the URI that represents path.
transitiveClosure<T>(Map<T, Iterable<T>> graph) Map<T, Set<T>>
Returns the transitive closure of graph.
withoutExtension(String path) String
Removes a trailing extension from the last part of path.

Exceptions / Errors

PathException
An exception class that's thrown when a path operation is unable to be computed accurately.