KeepassX format implementation in pure dart.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
714 B

import 'package:kdbx/src/kdbx_entry.dart';
import 'package:xml/xml.dart';
import 'kdbx_object.dart';
final _builder = XmlBuilder();
class KdbxGroup extends KdbxObject {
KdbxGroup(this.parent) : super.create('Group');
KdbxGroup.read(this.parent, XmlElement node) : super.read(node) {
node
.findElements('Group')
.map((el) => KdbxGroup.read(this, el))
.forEach(groups.add);
node
.findElements('Entry')
.map((el) => KdbxEntry.read(this, el))
.forEach(entries.add);
}
/// null if this is the root group.
final KdbxGroup parent;
final List<KdbxGroup> groups = [];
final List<KdbxEntry> entries = [];
String get name => text('Name') ?? '';
}