3 properties (Constant,GetAccess=
protected)
6 IGNORE_EXTENSIONS={
'asv',
'xml~'};
7 ALLOWED_EXTENSIONS={
'mat',
'xml'};
10 function self=HashMapMatXML(varargin)
19 {
'storageFormat';
self.storageFormat;
'isstring(x)'});
21 switch lower(
self.storageFormat)
24 self.loadKeyFunc=@(x)load(x,
'keyStr');
25 self.loadValueFunc=@(x)load(x,
'valueObj');
26 self.fileExtension=
self.MAT_EXTENSION;
27 self.isMissingKeyBlamed=
true;
29 self.saveFunc=@(x,y,z)
xmlsave(x,...
31 'valueObj',{evalin(
'caller',y)},...
32 'keyStr',{evalin(
'caller',z)}),...
36 self.fileExtension=
self.XML_EXTENSION;
37 self.isMissingKeyBlamed=
true;
40 throwerror(
'wrongInput',
'unknown storage format');
45 methods (Access=
protected)
46 function valueObj=getOne(self,keyStr)
48 WARN_TO_CATCH='badMatFile:wrongState';
50 valueObj=getOne@
mxberry.core.cont.ondisk.AHashMap(self,keyStr);
51 [lastWarnMsg,lastWarnId]=lastwarn();
52 nChars=length(WARN_TO_CATCH);
53 nWarnChars=length(lastWarnId);
54 indStart=max(1,nWarnChars-nChars)+1;
55 if strcmp(lastWarnId(indStart:end),WARN_TO_CATCH)
59 function [isPositive,keyStr]=checkKey(self,fileName)
61 if ~((strcmp(self.fileExtension,self.XML_EXTENSION))&&...
64 [isPositive,keyStr]=...
65 checkKey@
mxberry.core.cont.ondisk.AHashMap(...
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function xmlload(in fileName)
XMLLOAD loads XML file and converts it into Matlab structure or variable.
function parseparext(in args, in propNameValMat, in varargin)
PARSEPAREXT behaves in the same way as mxberry.core.parseparams but returns property values in a more...
DISKBASEDHASHMAP represents a hash map for the arbitrary objects on disk with a high level of persist...
function xmlsave(in fileName, in SData, in varargin)
XMLSAVE saves structure or variable(s) to a file using XML format.
function isfile(in fileName, in isJavaBased)
ISFILE returns true if a specified name corresponds to an existing file.