-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.bas
More file actions
52 lines (43 loc) · 1.23 KB
/
Utils.bas
File metadata and controls
52 lines (43 loc) · 1.23 KB
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
46
47
48
49
50
51
52
Attribute VB_Name = "Utils"
'@Folder "JSON.Utilities"
Option Explicit
Public Const DOUBLEQUOTE As String = """"
Public Const SEMICOLON As String = ":"
Public Enum JException
JUnexpectedKey = vbObjectError + 1
JUnexpectedCharacter = vbObjectError + 2
JUnexpectedToken = vbObjectError + 3
End Enum
Public Type VersionNumber
Major As Long
Minor As Long
Revision As Long
End Type
Public Enum JType
JSObject
JSArray
JSString
JSNumber
JSBoolean
JSNull
End Enum
#If DEV Then
Private Const ModuleName As String = "Utils"
#End If
Public Function GetValueAs(ByVal Value As Object, ByVal DataType As JSON.JType) As Object
#If DEV Then
Const FunctionName As String = "GetValueAs"
Dim Logger As JSON.Logger
Set Logger = Services.CreateLogger(Services.LibraryName & "." & ModuleName, FunctionName)
#End If
Dim JObject As Object
Set JObject = Services.GetValueAs(Value, DataType)
Set GetValueAs = JObject
End Function
Public Function Version() As VersionNumber
Dim VersionNumber As JSON.VersionNumber
VersionNumber.Major = 1
VersionNumber.Minor = 0
VersionNumber.Revision = 16
Version = VersionNumber
End Function