mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-06-27 14:53:11 +00:00
1.3
This commit is contained in:
@ -32,7 +32,7 @@ import 'Guid.dart';
|
||||
|
||||
class BinaryList
|
||||
{
|
||||
var _list = new List<int>();
|
||||
var _list = <int>[];
|
||||
|
||||
int get length => _list.length;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1019
lib/src/Data/DC.dart
1019
lib/src/Data/DC.dart
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,7 @@ class DataType
|
||||
ResourceLink = 0x11,
|
||||
String = 0x12,
|
||||
Structure = 0x13,
|
||||
Record = 0x14,
|
||||
//Stream,
|
||||
//Array = 0x80,
|
||||
VarArray = 0x80,
|
||||
@ -66,6 +67,7 @@ class DataType
|
||||
ResourceLinkArray = 0x91,
|
||||
StringArray = 0x92,
|
||||
StructureArray = 0x93,
|
||||
RecordArray = 0x94,
|
||||
NotModified = 0x7F,
|
||||
Unspecified = 0xFF;
|
||||
|
||||
|
@ -1,18 +1,23 @@
|
||||
import 'DC.dart';
|
||||
|
||||
class Guid
|
||||
{
|
||||
class Guid {
|
||||
DC _data;
|
||||
|
||||
Guid(DC data)
|
||||
{
|
||||
Guid(DC data) {
|
||||
_data = data;
|
||||
}
|
||||
|
||||
DC get value => _data;
|
||||
DC get value => _data;
|
||||
|
||||
bool operator ==(Object other) {
|
||||
if (other is Guid)
|
||||
return _data.sequenceEqual(other._data);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _data.getString(0, _data.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
32
lib/src/Data/IRecord.dart
Normal file
32
lib/src/Data/IRecord.dart
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2017 Ahmed Kh. Zamil
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
import '../Resource/Template/TemplateDescriber.dart';
|
||||
|
||||
|
||||
abstract class IRecord {
|
||||
Map<String, dynamic> serialize();
|
||||
void deserialize(Map<String, dynamic> value);
|
||||
TemplateDescriber get template;
|
||||
}
|
6
lib/src/Data/ParseResult.dart
Normal file
6
lib/src/Data/ParseResult.dart
Normal file
@ -0,0 +1,6 @@
|
||||
class ParseResult<T> {
|
||||
int size;
|
||||
T value;
|
||||
|
||||
ParseResult(this.size, this.value);
|
||||
}
|
25
lib/src/Data/Record.dart
Normal file
25
lib/src/Data/Record.dart
Normal file
@ -0,0 +1,25 @@
|
||||
import 'package:esiur/src/Resource/Template/TemplateDescriber.dart';
|
||||
|
||||
import 'IRecord.dart';
|
||||
import 'KeyList.dart';
|
||||
|
||||
class Record extends KeyList with IRecord {
|
||||
Map<String, dynamic> _props;
|
||||
|
||||
@override
|
||||
Map<String, dynamic> serialize() {
|
||||
return _props;
|
||||
}
|
||||
|
||||
@override
|
||||
deserialize(Map<String, dynamic> value) {
|
||||
_props = value;
|
||||
}
|
||||
|
||||
operator [](index) => _props[index];
|
||||
operator []=(index, value) => _props[index] = value;
|
||||
|
||||
@override
|
||||
// TODO: implement template
|
||||
TemplateDescriber get template => throw UnimplementedError();
|
||||
}
|
6
lib/src/Data/RecordComparisonResult.dart
Normal file
6
lib/src/Data/RecordComparisonResult.dart
Normal file
@ -0,0 +1,6 @@
|
||||
class RecordComparisonResult {
|
||||
static const Null = 0;
|
||||
static const Record = 1;
|
||||
static const RecordSameType = 2;
|
||||
static const Same = 3;
|
||||
}
|
5
lib/src/Data/ResourceArrayType.dart
Normal file
5
lib/src/Data/ResourceArrayType.dart
Normal file
@ -0,0 +1,5 @@
|
||||
class ResourceArrayType {
|
||||
static const int Dynamic = 0x0;
|
||||
static const int Static = 0x10;
|
||||
static const Wrapper = 0x20;
|
||||
}
|
Reference in New Issue
Block a user