Changeset 245 for trunk/lingosource/castlib1/alexUtilities.ls
- Timestamp:
- 03/21/10 11:39:48 (2 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib1/alexUtilities.ls (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/alexUtilities.ls
r244 r245 38 38 property pCaseLists 39 39 40 property pCachedFiles 41 40 42 41 43 on new me 44 pCachedFiles = [:] 42 45 ancestor = new(script "PseudoXMLPS") -- we need this script later 43 46 -- and as we may already be in the scope of the stage, we use it as ancestor … … 124 127 ----------------------------------- 125 128 129 theResult = pCachedFiles.getaprop(pfad) 130 if listP(theResult) then return theResult 131 126 132 theResult = [:] 127 133 dertext = mGetTextFromFile(me, pfad) 128 134 if length(dertext) > 0 then 129 135 statusSwitched = mSwitchToStatusMode(me, 1) 130 theResult = mGetListFromXMLString(me, dertext) 136 theResult = mGetListFromXMLStringX(me, dertext) 137 pCachedFiles.setaProp(pfad, theResult) 131 138 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 132 139 end if 133 140 return theResult 141 end 142 143 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 144 145 on mClearXML_Cache me, string_fullPath 146 ----------------------------------- 147 -- ACTION: We have a cache for xml files, sio that we do not need to parse the same 148 -- file over and over again, as itis time consuming esp. during repeat loops 149 -- so we store the result in pCachedFiles by filename. 150 -- In order to flush this cache for either one file (with parameter) or all files 151 -- (without parameter) use this handler 152 -- 153 -- INPUT: <string_fullPath> ; string ; full pathname ; optional => default "" => clear all cahced files 154 -- RETURNS: - 155 ----------------------------------- 156 157 string_fullPath = string(string_fullPath) 158 if length(string_fullPath) > 0 then 159 pCachedFiles.deleteProp(string_fullPath) 160 else 161 pCachedFiles = [:] 162 end if 134 163 end 135 164 … … 149 178 if not(list(theList)) then theList = [:] 150 179 end if 180 pCachedFiles.setaProp(thePath, theList) 151 181 theResult = mGetXMLStringFromList(me, theList) 152 182 return mSaveToTextFile(me, theResult, thePath) … … 2927 2957 end 2928 2958 2929 2930 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2931 2932 on mGetWindowsHomeFolder me2933 2934 if mCheckForXtra(me, "Shell") = 0 then2935 home = mDoShellCmd(me, "echo %HOMEPATH%", void, void, 1)2936 home = home[1]2937 else if mCheckForXtra(me, "BudAPI") then2938 olddelim = the itemdelimiter2939 the itemdelimiter = "\"2940 home = baSysFolder("personal")2941 if the last char of home = "\" then delete the last char of home2942 if the last item of home = "Documents" then delete the last item of home2943 the itemdelimiter = olddelim2944 else2945 home = ""2946 end if2947 2948 return home2949 end2950 2951 2959 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2952 2960 on _______________GLOSSARY_ITEMS me … … 3532 3540 end if 3533 3541 3534 -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÁÀ"&vA& "ÄÃÅÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙÜÆØ" 3535 -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà"&"â"&"äãåçéèêëíìîïñóòôöõúùûüæøÿ" 3536 pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Á", "À", vA, "A", "Ä", "Ã", "Å", "Ç", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ñ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ú", "Ù", "U", "Ü", "Æ", "Ø", "", ""]) 3537 pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à", vA, "â", "ä", "ã", "å", "ç", "é", "è", "ê", "ë", "í", "ì", "î", "ï", "ñ", "ó", "ò", "ô", "ö", "õ", "ú", "ù", "û", "ü", "æ", "ø", "", "ÿ"]) 3542 -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZçË"&vA& "Ìéæèêíëìîñï 3543 ÍòôÛ®¯ÎÙ" 3544 -- pLowercase = "abcdefghijklmnopqrstuvwxyz"&""&"Ÿ¿ÏØ" 3545 pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ç", "Ë", vA, "A", "", "Ì", "", "", "", "é", "æ", "è", "ê", "í", "ë", "ì", "", "î", "ñ", "ï", " 3546 ", "Í", "ò", "ô", "U", "", "®", "¯", "Î", "Ù"]) 3547 pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "", "", vA, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Ÿ", "¿", "Ï", "Ø"]) 3538 3548 3539 3549 end
Note: See TracChangeset
for help on using the changeset viewer.
