Skip to content

Commit 8f92ec9

Browse files
committed
migrate file create methods to glue
1 parent 6114938 commit 8f92ec9

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

nix_mx.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ void mexFunction(int nlhs,
9595
.reg("deleteBlock", REMOVER(nix::Block, nix::File, deleteBlock))
9696
.reg("deleteSection", REMOVER(nix::Section, nix::File, deleteSection))
9797
.reg("openBlock", GETBYSTR(nix::Block, nix::File, getBlock))
98-
.reg("openSection", GETBYSTR(nix::Section, nix::File, getSection));
99-
methods->add("File::createBlock", nixfile::create_block);
100-
methods->add("File::createSection", nixfile::create_section);
98+
.reg("openSection", GETBYSTR(nix::Section, nix::File, getSection))
99+
.reg("createBlock", &nix::File::createBlock)
100+
.reg("createSection", &nix::File::createSection);
101101

102102
classdef<nix::Block>("Block", methods)
103103
.desc(&nixblock::describe)

src/nixfile.cc

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,4 @@ mxArray *describe(const nix::File &fd) {
3939
return sb.array();
4040
}
4141

42-
void create_block(const extractor &input, infusor &output)
43-
{
44-
nix::File currObj = input.entity<nix::File>(1);
45-
nix::Block newBlock = currObj.createBlock(input.str(2), input.str(3));
46-
47-
handle nbh = handle(newBlock);
48-
output.set(0, nbh);
49-
}
50-
51-
void create_section(const extractor &input, infusor &output)
52-
{
53-
nix::File currObj = input.entity<nix::File>(1);
54-
nix::Section newSection = currObj.createSection(input.str(2), input.str(3));
55-
56-
handle nsh = handle(newSection);
57-
output.set(0, nsh);
58-
}
59-
6042
} // namespace nixfile

src/nixfile.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ void open(const extractor &input, infusor &output);
99

1010
mxArray *describe(const nix::File &f);
1111

12-
void create_block(const extractor &input, infusor &output);
13-
14-
void create_section(const extractor &input, infusor &output);
15-
1612
} // namespace nixfile
1713

1814
#endif

0 commit comments

Comments
 (0)