mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-23 21:11:08 +00:00
Added ReadDelegates overload that works with a XPathNavigator directly. Necessary for new overrides.xml handling.
This commit is contained in:
parent
58bebc8315
commit
47b16778ce
|
@ -40,20 +40,13 @@ namespace Bind
|
|||
|
||||
class XmlSpecReader : ISpecReader
|
||||
{
|
||||
public DelegateCollection ReadDelegates(StreamReader specFile)
|
||||
#region Public Members
|
||||
|
||||
public DelegateCollection ReadDelegates(XPathNavigator specs)
|
||||
{
|
||||
DelegateCollection delegates = new DelegateCollection();
|
||||
XPathDocument specs = new XPathDocument(specFile);
|
||||
XPathDocument overrides = new XPathDocument(new StreamReader(
|
||||
Path.Combine(Settings.InputPath, Settings.OverridesFile)));
|
||||
|
||||
foreach (XPathNavigator nav in new XPathNavigator[] {
|
||||
specs.CreateNavigator().SelectSingleNode("/signatures"),
|
||||
overrides.CreateNavigator().SelectSingleNode("/overrides/add") })
|
||||
{
|
||||
if (nav != null)
|
||||
{
|
||||
foreach (XPathNavigator node in nav.SelectChildren("function", String.Empty))
|
||||
foreach (XPathNavigator node in specs.SelectChildren("function", String.Empty))
|
||||
{
|
||||
var name = node.GetAttribute("name", String.Empty);
|
||||
|
||||
|
@ -101,12 +94,20 @@ namespace Bind
|
|||
|
||||
delegates.Add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return delegates;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISpecReader Members
|
||||
|
||||
public DelegateCollection ReadDelegates(StreamReader specFile)
|
||||
{
|
||||
XPathDocument specs = new XPathDocument(specFile);
|
||||
return ReadDelegates(specs.CreateNavigator().SelectSingleNode("/signatures/add"));
|
||||
}
|
||||
|
||||
public Dictionary<string, string> ReadTypeMap(StreamReader specFile)
|
||||
{
|
||||
Console.WriteLine("Reading opengl types.");
|
||||
|
@ -205,8 +206,8 @@ namespace Bind
|
|||
Path.Combine(Settings.InputPath, Settings.OverridesFile)));
|
||||
|
||||
foreach (XPathNavigator nav in new XPathNavigator[] {
|
||||
specs.CreateNavigator().SelectSingleNode("/signatures"),
|
||||
overrides.CreateNavigator().SelectSingleNode("/overrides/add") })
|
||||
specs.CreateNavigator().SelectSingleNode("/signatures/add"),
|
||||
overrides.CreateNavigator().SelectSingleNode("/signatures/add") })
|
||||
{
|
||||
if (nav != null)
|
||||
{
|
||||
|
@ -282,5 +283,7 @@ namespace Bind
|
|||
Utilities.Merge(enums, all);
|
||||
return enums;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue