-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new schema.jar now works with default generateCore and generateExtens…
…ion. file export is now possible.
- Loading branch information
Showing
7 changed files
with
84 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
%returns sources given namespace java object | ||
function s = getNamespaceInfo(namespaceMap) | ||
errid = 'MATNWB:INVALIDFILE'; | ||
errmsg = 'Could not read namespace file. Invalid format.'; | ||
|
||
assert(namespaceMap.containsKey('namespaces'), errid, errmsg); | ||
namespaceIter = namespaceMap.get('namespaces').iterator(); | ||
|
||
%spawn empty struct. Produce struct array of all defined namespaces | ||
s = struct('filenames', {}, 'name', {}, 'dependencies', {}, 'version', {}); | ||
sidx = 1; | ||
while namespaceIter.hasNext() | ||
namespace = namespaceIter.next(); | ||
assert(namespace.containsKey('name')... | ||
&& namespace.containsKey('schema')... | ||
&& namespace.containsKey('version'),... | ||
errid, errmsg); | ||
name = namespace.get('name'); | ||
version = namespace.get('version'); | ||
filenames = {}; | ||
dependencies = {}; | ||
schemaIter = namespace.get('schema').iterator(); | ||
while schemaIter.hasNext() | ||
schemaFile = schemaIter.next(); | ||
if schemaFile.containsKey('source') | ||
filenames{end+1} = schemaFile.get('source'); | ||
elseif schemaFile.containsKey('namespace') | ||
dependencies{end+1} = schemafile.get('namespace'); | ||
else | ||
error(errid, errmsg); | ||
end | ||
end | ||
s(sidx) = struct('name', name,... | ||
'filenames', {filenames},... | ||
'dependencies', {dependencies},... | ||
'version', version); | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function processed = getSourceInfo(classmap) | ||
%given containers.Map of (file/module)->(string) returns (file/module)->HashMap | ||
% representing the schema file. | ||
processed = containers.Map; | ||
schema = Schema(); | ||
classkeys = keys(classmap); | ||
|
||
for i=1:length(classkeys) | ||
ck = classkeys{i}; | ||
cval = classmap(ck); | ||
try | ||
processed(ck) = schema.read(cval); | ||
catch ME | ||
error('MATNWB:INVALIDFILE',... | ||
'Data for namespace source `%s` is invalid', ck); | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters