mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-30 11:02:31 -06:00
55 lines
2.1 KiB
Java
55 lines
2.1 KiB
Java
package androidx.media3.common.util;
|
|
|
|
import org.xmlpull.v1.XmlPullParser;
|
|
import org.xmlpull.v1.XmlPullParserException;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class XmlPullParserUtil {
|
|
private XmlPullParserUtil() {
|
|
}
|
|
|
|
public static boolean isEndTag(XmlPullParser xmlPullParser, String str) throws XmlPullParserException {
|
|
return isEndTag(xmlPullParser) && xmlPullParser.getName().equals(str);
|
|
}
|
|
|
|
public static boolean isEndTag(XmlPullParser xmlPullParser) throws XmlPullParserException {
|
|
return xmlPullParser.getEventType() == 3;
|
|
}
|
|
|
|
public static boolean isStartTag(XmlPullParser xmlPullParser, String str) throws XmlPullParserException {
|
|
return isStartTag(xmlPullParser) && xmlPullParser.getName().equals(str);
|
|
}
|
|
|
|
public static boolean isStartTag(XmlPullParser xmlPullParser) throws XmlPullParserException {
|
|
return xmlPullParser.getEventType() == 2;
|
|
}
|
|
|
|
public static boolean isStartTagIgnorePrefix(XmlPullParser xmlPullParser, String str) throws XmlPullParserException {
|
|
return isStartTag(xmlPullParser) && stripPrefix(xmlPullParser.getName()).equals(str);
|
|
}
|
|
|
|
public static String getAttributeValue(XmlPullParser xmlPullParser, String str) {
|
|
int attributeCount = xmlPullParser.getAttributeCount();
|
|
for (int i = 0; i < attributeCount; i++) {
|
|
if (xmlPullParser.getAttributeName(i).equals(str)) {
|
|
return xmlPullParser.getAttributeValue(i);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static String getAttributeValueIgnorePrefix(XmlPullParser xmlPullParser, String str) {
|
|
int attributeCount = xmlPullParser.getAttributeCount();
|
|
for (int i = 0; i < attributeCount; i++) {
|
|
if (stripPrefix(xmlPullParser.getAttributeName(i)).equals(str)) {
|
|
return xmlPullParser.getAttributeValue(i);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private static String stripPrefix(String str) {
|
|
int indexOf = str.indexOf(58);
|
|
return indexOf == -1 ? str : str.substring(indexOf + 1);
|
|
}
|
|
}
|