This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docs.cfc
45 lines (29 loc) · 1.58 KB
/
docs.cfc
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
41
42
43
44
45
<cfcomponent output="false">
<cffunction name="init" returntype="any">
<cfreturn this>
</cffunction>
<cffunction name="renderBody" returntype="string">
<cfargument name="b" required="true">
<cfset arguments.b = XmlFormat( arguments.b )>
<cfset arguments.b = Replace( arguments.b, "{{{", "<pre>", "ALL")>
<cfset arguments.b = Replace( arguments.b, "}}}", "</pre>", "ALL")>
<cfset this.urlRE = "((http|https)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,/\\\+&%\$##\=~])*)">
<cfset arguments.b = rereplacenocase( arguments.b, this.urlRE, "<a href='\1' target='_blank'>\1</a>", "ALL")>
<cfreturn ParagraphFormat( arguments.b )>
</cffunction>
<cfset this.prefix = "spreadsheet,get,array,struct,socket,system,nx,bit,binary,cache,collection,create,date,file,find,html,ip,image,is,list,ls,query,set,jmx,java,to,mapping,xml,replace,span,sqs,thread,url,write,yes,amazon,directory,delete,salesforce,mongo">
<cffunction name="getCamelCase" returntype="string">
<cfargument name="funcname">
<cfset var st = "">
<cfloop list="#this.prefix#" index="st" delimiters=",">
<cfif ( arguments.funcname.startsWith( st ) && Len(arguments.funcname) > Len(st) )>
<cfset var b = arguments.funcname.substring(0,1).toUpperCase()>
<cfset b = b & st.substring( 1 )>
<cfset b = b & arguments.funcname.substring( st.length(), st.length()+1 ).toUpperCase()>
<cfset b = b & arguments.funcname.substring( st.length()+1 )>
<cfreturn b>
</cfif>
</cfloop>
<cfreturn arguments.funcname.substring(0,1).toUpperCase() & arguments.funcname.substring(1)>
</cffunction>
</cfcomponent>