Skip to content

Commit f71556e

Browse files
committed
removeLists from Section
1 parent 18cd034 commit f71556e

File tree

5 files changed

+4
-30
lines changed

5 files changed

+4
-30
lines changed

+nix/Section.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@
7373
% Section methods
7474
% ----------------
7575

76-
function lst = list_sections(obj)
77-
lst = nix_mx('Section::listSections', obj.nix_handle);
78-
end;
79-
8076
function sections = get.sections(obj)
8177
[obj.sectionsCache, sections] = nix.Utils.fetchObjList(obj.updatedAt, ...
8278
'Section::sections', obj.nix_handle, obj.sectionsCache, @nix.Section);
@@ -100,7 +96,7 @@
10096

10197
function props = get.properties_cell(obj)
10298
[obj.propsCache, props] = nix.Utils.fetchPropList(obj.updatedAt, ...
103-
'Section::listProperties', obj.nix_handle, obj.propsCache);
99+
'Section::properties', obj.nix_handle, obj.propsCache);
104100
end
105101

106102
function p_map = get.properties_map(obj)

nix_mx.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ const std::vector<fendpoint> funcs = {
8383

8484
// Section
8585
{ "Section::describe", nixsection::describe },
86-
{ "Section::listSections", nixsection::list_sections },
87-
{ "Section::listProperties", nixsection::list_properties }
86+
{ "Section::properties", nixsection::properties }
8887
};
8988

9089
//glue "globals"

src/nixsection.cc

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,7 @@ void describe(const extractor &input, infusor &output)
2929
output.set(0, sb.array());
3030
}
3131

32-
void list_sections(const extractor &input, infusor &output)
33-
{
34-
nix::Section section = input.entity<nix::Section>(1);
35-
std::vector<nix::Section> sections = section.sections();
36-
37-
struct_builder sb({ sections.size() }, { "name", "id", "type" });
38-
39-
for (const auto &b : sections) {
40-
sb.set(b.name());
41-
sb.set(b.id());
42-
sb.set(b.type());
43-
44-
sb.next();
45-
}
46-
47-
output.set(0, sb.array());
48-
}
49-
50-
void list_properties(const extractor &input, infusor &output)
32+
void properties(const extractor &input, infusor &output)
5133
{
5234
nix::Section section = input.entity<nix::Section>(1);
5335
std::vector<nix::Property> properties = section.properties();

src/nixsection.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ namespace nixsection {
77

88
void describe(const extractor &input, infusor &output);
99

10-
void list_sections(const extractor &input, infusor &output);
11-
12-
void list_properties(const extractor &input, infusor &output);
10+
void properties(const extractor &input, infusor &output);
1311

1412
} // namespace nixfile
1513

tests/TestSection.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
f = nix.File(fullfile(pwd, 'tests', 'test.h5'), nix.FileMode.ReadOnly);
1717
s1 = f.sections{3};
1818

19-
assert(size(s1.list_sections(),1) == 4);
2019
assert(size(s1.sections, 1) == 4);
2120
end
2221

0 commit comments

Comments
 (0)