Use XML format in PlistParser (#94863)
* Switch to use xml in PlistParser * Review feedbacks: Change dynamic to Object, remove getValueFromFile
This commit is contained in:
@@ -289,20 +289,26 @@ class FakeStdio extends Stdio {
|
||||
}
|
||||
|
||||
class FakePlistParser implements PlistParser {
|
||||
final Map<String, dynamic> _underlyingValues = <String, String>{};
|
||||
FakePlistParser([Map<String, Object>? underlyingValues]):
|
||||
_underlyingValues = underlyingValues ?? <String, Object>{};
|
||||
|
||||
void setProperty(String key, dynamic value) {
|
||||
final Map<String, Object> _underlyingValues;
|
||||
|
||||
void setProperty(String key, Object value) {
|
||||
_underlyingValues[key] = value;
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> parseFile(String plistFilePath) {
|
||||
String? plistXmlContent(String plistFilePath) => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Map<String, Object> parseFile(String plistFilePath) {
|
||||
return _underlyingValues;
|
||||
}
|
||||
|
||||
@override
|
||||
String getValueFromFile(String plistFilePath, String key) {
|
||||
return _underlyingValues[key] as String;
|
||||
String? getStringValueFromFile(String plistFilePath, String key) {
|
||||
return _underlyingValues[key] as String?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user