3 properties (Constant,GetAccess=
protected)
5 IGNORE_EXTENSIONS={
'asv',
'xml~'};
6 ALLOWED_EXTENSIONS={
'xml'};
9 function self=HashMapXMLMetaData(varargin)
15 [regArgList,~,storageFormat]=
parseparext(varargin,...
16 {
'storageFormat';
'verxml';...
17 'isstring(x)&&ismember(x,{''verxml'',''none''})'});
19 if ~
ismember(storageFormat,{
'verxml',
'none'})
20 throwerror(
'wrongInput',
'storage format %s unknown',...
25 'storageFormat',storageFormat);
27 switch lower(
self.storageFormat)
33 self.fileExtension=
self.XML_EXTENSION;
34 self.isMissingKeyBlamed=
true;
36 self.saveFunc=@(x,y,z,w)1;
37 self.loadKeyFunc=@(x)1;
38 self.loadValueFunc=@(x)1;
39 self.isMissingKeyBlamed=
true;
42 'storage format %s is unknown',
self.storageFormat);
47 methods (Access=
protected, Static)
48 function saveFunc(fileName,valueObjName,keyObjName,varargin)
50 'valueObj',{evalin(
'caller',valueObjName)},...
51 'keyStr',{evalin(
'caller',keyObjName)}),...
52 'on',varargin{:},
'insertTimestamp',
false);
55 methods (Access=
protected)
56 function [isPositive,keyStr]=checkKey(self,fileName)
58 if (strcmp(self.fileExtension,self.XML_EXTENSION))&&(nargout<2)
62 [isPositive,keyStr]=checkKey@
mxberry.core.cont.ondisk.AHashMap(...
66 function putOne(self,keyStr,valueObj,varargin)
68 fullFileName=self.genfullfilename(keyStr);
70 self.saveFunc(fullFileName,'valueObj','keyStr',varargin{:});
76 if self.isPutErrorIgnored
78 'cannot save the key value: %s',...
87 function [valueObj,metaData]=getOne(
self,keyStr)
88 fileName=
self.getFileNameByKey(keyStr);
89 [resObj,metaData]=
self.loadValueFunc(fileName);
90 valueObj=resObj.valueObj;
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 parseparext(in args, in propNameValMat, in varargin)
PARSEPAREXT behaves in the same way as mxberry.core.parseparams but returns property values in a more...
function throwwarn(in msgTag, in varargin)
THROWWARN works similarly to built-in WARNING function in case when there is no output arguments but ...
DISKBASEDHASHMAP represents a hash map for the arbitrary objects on disk with a high level of persist...
function isfile(in fileName, in isJavaBased)
ISFILE returns true if a specified name corresponds to an existing file.
function ismember(in leftVec, in rightVec, in varargin)
ISMEMBER - ismember implementation for arrays of any type.