|
11 | 11 | % blocks access to all nix.Block child entities.
|
12 | 12 | % sections access to all first level nix.Section child entities.
|
13 | 13 | %
|
| 14 | +% Example opening a NIX file: |
| 15 | +% getFileAccess = nix.File('/path/to/file', nix.FileMode.ReadWrite); |
| 16 | +% |
14 | 17 | % See also nix.Block, nix.Section.
|
15 | 18 | %
|
16 | 19 | %
|
|
32 | 35 | function obj = File(path, mode)
|
33 | 36 | % File constructor used to open or create a nix.File.
|
34 | 37 | %
|
35 |
| - % path (char): path to a file to open or create. |
36 |
| - % mode (char): requires a valid nix.FileMode. Defaults to |
37 |
| - % nix.FileMode.ReadWrite if no FileMode is provided. |
| 38 | + % path (char): Path to a file to open or create. |
| 39 | + % mode (char): Requires a valid nix.FileMode. Defaults to |
| 40 | + % nix.FileMode.ReadWrite if no FileMode is provided. |
38 | 41 | %
|
39 | 42 | % Returns: (nix.File).
|
40 | 43 | %
|
| 44 | + % Example: getFileAccess = nix.File('/path/to/file', nix.FileMode.ReadWrite); |
| 45 | + % |
41 | 46 | % See also nix.FileMode.
|
42 | 47 |
|
43 | 48 | if (~exist('mode', 'var'))
|
|
56 | 61 | % Check if the file is currently open.
|
57 | 62 | %
|
58 | 63 | % Returns: (logical) True if the file is open, False otherwise.
|
| 64 | + % |
| 65 | + % Example: check = currFile.isOpen(); |
59 | 66 |
|
60 | 67 | fname = strcat(obj.alias, '::isOpen');
|
61 | 68 | r = nix_mx(fname, obj.nixhandle);
|
|
66 | 73 | %
|
67 | 74 | % Returns: (nix.FileMode).
|
68 | 75 | %
|
| 76 | + % Example: getFileMode = currFile.fileMode(); |
| 77 | + % |
69 | 78 | % See also nix.FileMode.
|
70 | 79 |
|
71 | 80 | fname = strcat(obj.alias, '::fileMode');
|
|
79 | 88 | % offending entities.
|
80 | 89 | %
|
81 | 90 | % Returns: (struct) Custom warning/error struct.
|
| 91 | + % |
| 92 | + % Example: checkFile = currFile.validate(); |
82 | 93 |
|
83 | 94 | fname = strcat(obj.alias, '::validate');
|
84 | 95 | r = nix_mx(fname, obj.nixhandle);
|
|
91 | 102 | function r = createBlock(obj, name, type)
|
92 | 103 | % Create a new nix.Block entity, that is immediately persisted to the file.
|
93 | 104 | %
|
94 |
| - % name (char): the name of the Block, has to be unique within the file. |
95 |
| - % read only Block property. |
96 |
| - % type (char): the type of the Block, required. |
97 |
| - % Type can be used to give semantic meaning to an entity |
98 |
| - % and expose it to search methods in a broader context. |
99 |
| - % read/write Block property. |
| 105 | + % name (char): The name of the Block, has to be unique within the file. |
| 106 | + % type (char): The type of the Block, required. |
| 107 | + % Type can be used to give semantic meaning to an entity |
| 108 | + % and expose it to search methods in a broader context. |
100 | 109 | %
|
101 |
| - % Returns: (nix.Block) The newly created Block. |
| 110 | + % Returns: (nix.Block) The newly created Block. |
102 | 111 | %
|
103 |
| - % Example: newBlock = f.createBlock('trial1', 'ephys'); |
| 112 | + % Example: newBlock = f.createBlock('trial1', 'ephys'); |
104 | 113 | %
|
105 | 114 | % See also nix.Block.
|
106 | 115 |
|
|
174 | 183 | % will be deleted from the file as well.
|
175 | 184 | %
|
176 | 185 | % idNameEntity (char/nix.Block): Name or id of the entity to
|
177 |
| - % be deleted or the entity itself. |
| 186 | + % be deleted or the entity itself. |
178 | 187 | %
|
179 | 188 | % Returns: (logical) True if the Block has been removed, false otherwise.
|
180 | 189 | %
|
|
190 | 199 | function r = filterBlocks(obj, filter, val)
|
191 | 200 | % Get a filtered cell array of all Blocks within this file.
|
192 | 201 | %
|
193 |
| - % filter (nix.Filter): the nix.Filter to be applied. Supports |
194 |
| - % the filters 'acceptall', 'id', 'ids', |
| 202 | + % filter (nix.Filter): The nix.Filter to be applied. Supports |
| 203 | + % The filters 'acceptall', 'id', 'ids', |
195 | 204 | % 'name' and 'type'.
|
196 | 205 | % val (char): Value that is applied with the selected
|
197 | 206 | % filter.
|
198 | 207 | %
|
199 | 208 | % Returns: ([nix.Block]) A cell array of Blocks filtered according
|
200 |
| - % to the applied nix.Filter. |
| 209 | + % to the applied nix.Filter. |
201 | 210 | %
|
202 | 211 | % Example: getBlocks = f.filterBlocks(nix.Filter.type, 'ephys');
|
203 | 212 | %
|
|
213 | 222 | function r = createSection(obj, name, type)
|
214 | 223 | % Create a new nix.Section entity, that is immediately persisted to the file.
|
215 | 224 | %
|
216 |
| - % name (char): the name of the Section, has to be unique within the file. |
217 |
| - % read only Section property. |
218 |
| - % type (char): the type of the Section, required. |
219 |
| - % Type can be used to give semantic meaning to an entity |
220 |
| - % and expose it to search methods in a broader context. |
221 |
| - % read/write Section property. |
| 225 | + % name (char): The name of the Section, has to be unique within the file. |
| 226 | + % type (char): The type of the Section, required. |
| 227 | + % Type can be used to give semantic meaning to an entity |
| 228 | + % and expose it to search methods in a broader context. |
222 | 229 | %
|
223 |
| - % Returns: (nix.Section) The newly created Section. |
| 230 | + % Returns: (nix.Section) The newly created Section. |
224 | 231 | %
|
225 |
| - % Example: newSec = f.createSection('settings1', 'ephys'); |
| 232 | + % Example: newSec = f.createSection('settings1', 'ephys'); |
226 | 233 | %
|
227 | 234 | % See also nix.Section.
|
228 | 235 |
|
|
232 | 239 | end
|
233 | 240 |
|
234 | 241 | function r = sectionCount(obj)
|
235 |
| - % Get the number of root Sections in the file. |
| 242 | + % Get the number of direct child Sections in the file. |
236 | 243 | %
|
237 |
| - % Returns: (uint) The number of root (non nested) Sections. |
| 244 | + % Returns: (uint) The number of direct child (non nested) Sections. |
238 | 245 | %
|
239 | 246 | % Example: sc = f.sectionCount();
|
240 | 247 | %
|
|
264 | 271 | % idName (char): Name or ID of the Section.
|
265 | 272 | %
|
266 | 273 | % Returns: (nix.Section) The nix.Section or an empty cell,
|
267 |
| - % if the Section was not found. |
| 274 | + % if the Section was not found. |
268 | 275 | %
|
269 | 276 | % Example: getSec = f.openSection('23bb8a99-1812-4bc6-a52c-45e96864756b');
|
270 | 277 | % getSec = f.openSection('settings1');
|
|
275 | 282 | end
|
276 | 283 |
|
277 | 284 | function r = openSectionIdx(obj, index)
|
278 |
| - % Retrieves an existing Section from the file, accessed by index. |
| 285 | + % Retrieves an Section from the file, accessed by index. |
279 | 286 | %
|
280 | 287 | % index (double): The index of the Section to read.
|
281 | 288 | %
|
|
312 | 319 | function r = filterSections(obj, filter, val)
|
313 | 320 | % Get a filtered cell array of all root Sections within this file.
|
314 | 321 | %
|
315 |
| - % filter (nix.Filter): the nix.Filter to be applied. Supports |
316 |
| - % the filters 'acceptall', 'id', 'ids', |
| 322 | + % filter (nix.Filter): The nix.Filter to be applied. Supports |
| 323 | + % The filters 'acceptall', 'id', 'ids', |
317 | 324 | % 'name' and 'type'.
|
318 | 325 | % val (char): Value that is applied with the selected
|
319 | 326 | % filter.
|
|
357 | 364 | %
|
358 | 365 | % maxDepth (double): The maximum depth of traversal to retrieve nested
|
359 | 366 | % Sections. Should be handled like an index.
|
360 |
| - % filter (nix.Filter): the nix.Filter to be applied. Supports |
361 |
| - % the filters 'acceptall', 'id', 'ids', |
362 |
| - % 'name' and 'type'. |
363 |
| - % val (char): Value that is applied with the selected |
364 |
| - % filter. |
| 367 | + % filter (nix.Filter): The nix.Filter to be applied. Supports the filters |
| 368 | + % 'acceptall', 'id', 'ids', 'name' and 'type'. |
| 369 | + % val (char): Value that is applied with the selected filter. |
365 | 370 | %
|
366 | 371 | % Example: allSec = f.filterFindSections(2, nix.Filter.type, 'ephys');
|
367 | 372 | %
|
|
0 commit comments