time | Calls | line |
---|
| | 16 | function func = accessMap(op,name,func)
|
< 0.001 | 2 | 17 | persistent functionMap;
|
< 0.001 | 2 | 18 | if isempty(functionMap),functionMap = struct();end
|
| | 19 |
|
| | 20 |
|
| | 21 | % add a function to the map
|
< 0.001 | 2 | 22 | switch(op)
|
< 0.001 | 2 | 23 | case 'add'
|
| | 24 | if ~isa(func,'matlab.io.internal.functions.ExecutableFunction')
|
| | 25 | error('Not a function');
|
| | 26 | end
|
| | 27 | functionMap.(name) = func;
|
< 0.001 | 2 | 28 | case 'get'
|
| | 29 | import matlab.io.internal.functions.*
|
< 0.001 | 2 | 30 | try
|
| | 31 | % If a function has already been registered, get that function
|
| | 32 | % from the MAP. (Functions are value objects)
|
< 0.001 | 2 | 33 | func = functionMap.(name);
|
< 0.001 | 2 | 34 | return
|
| | 35 | catch
|
| | 36 | % Try to add one of the known functions.
|
| | 37 | switch (name)
|
| | 38 | case 'detectImportOptions'
|
| | 39 | func = DetectImportOptions;
|
| | 40 | case 'readcell'
|
| | 41 | func = ReadCell;
|
| | 42 | case 'readtable'
|
| | 43 | func = ReadTable;
|
| | 44 | case 'readmatrix'
|
| | 45 | func = ReadMatrix;
|
| | 46 | case 'readtimetable'
|
| | 47 | func = ReadTimeTable;
|
| | 48 | case 'readvars'
|
| | 49 | func = ReadVars;
|
| | 50 | case 'readlines'
|
| | 51 | func = ReadLines;
|
| | 52 | case 'readstruct'
|
| | 53 | func = ReadStruct;
|
| | 54 | case 'table2timetable'
|
| | 55 | func = Table2Timetable;
|
| | 56 | case 'readtableWithImportOptions'
|
| | 57 | func = ReadTableWithImportOptions;
|
| | 58 | case 'readtimetableWithImportOptions'
|
| | 59 | func = ReadTimeTableWithImportOptions;
|
| | 60 | case 'readcellWithImportOptions'
|
| | 61 | func = ReadCellWithImportOptions;
|
| | 62 | case 'readmatrixWithImportOptions'
|
| | 63 | func = ReadMatrixWithImportOptions;
|
| | 64 | case 'readvarsWithImportOptions'
|
| | 65 | func = ReadVarsWithImportOptions;
|
| | 66 | case 'setvaropts'
|
| | 67 | func = SetVarOpts;
|
| | 68 | otherwise
|
| | 69 | error('Unknown Function');
|
| | 70 | end
|
| | 71 | functionMap.(name) = func;
|
| | 72 | end
|
| | 73 | end
|
| | 74 | end
|
Other subfunctions in this file are not included in this listing.