-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCPM.LIB.inc.xml
40 lines (32 loc) · 1.53 KB
/
CPM.LIB.inc.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Routine name="CPM.LIB" type="INC"><![CDATA[
#include %occInclude
#include %occErrors
#; get value from array with default
#define GetParam(%arr,%name,%def) $select($data(%arr(%name),tmpRes)&&(tmpRes'=""):tmpRes,1:%def)
#define UrlParser(%url,%parsed) if $data(%url)=1 { do ##class(%Net.URLParser).Parse(%url, .%parsed) } else { merge %parsed=%url }
#define CpmVar ^||CPM.Main
#define CpmInstance ##class(CPM.Main).%Instance()
#define CpmConfig $$$CpmInstance.Config
#define CpmRegistry $$$CpmInstance.Registry
#define CpmInstall $$$CpmInstance.install
#define CpmSearch $$$CpmInstance.search
#define UtilMakePath(%dir,%name) ##class(%Library.File).NormalizeFilename(%name,%dir)
#define UtilConcatPath(%dir,%name) ##class(%Library.File).SubDirectoryName(%dir,%name)
#; session global suppose to be not mapped to the central CPM database
#define CpmSessionGlobal $name(^CPM.Session)
#define CpmLastPkgName @$$$CpmSessionGlobal@("LastPackage")
#define CpmLastPkgJson @$$$CpmSessionGlobal@("Package.json")
#define CPMCOMPILELOG(%s) set ^cpm.compile.log($increment(^cpm.compile.log)) = ##quote(%s)_"="_%s
#; FIXME - doesn't work yet - return after %ParseJSON made to work with user types
#if 0 ;$$$comClassDefined("%Library.Array")
#define JsonObject %Object
#define JsonProvider %ZEN.Auxiliary.altJSONProvider
#else
#define JsonObject %ZEN.proxyObject
#define JsonProvider %ZEN.Auxiliary.jsonProvider
#endif
#define MaxReasonableResponseSize 1000000
]]></Routine>
</Export>