vbAccelerator - Contents of code file: cTypeLibInfo.cls

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "cTypeLibInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public Name As String
Public CLSID As String
Public Ver As String
Public Path As String
Public Exists As Boolean

Public Function ToXml() As String
Dim sRet As String
   sRet = "<TypeLib name="""
   sRet = sRet & ParseXml(Name) & """ clsId="""
   sRet = sRet & CLSID & """ version="""
   sRet = sRet & Ver & """ path="""
   sRet = sRet & ParseXml(Path) & """ exists="""
   If (Exists) Then
      sRet = sRet & "yes"
   Else
      sRet = sRet & "no"
   End If
   ToXml = sRet & """ />"
End Function

Private Function ParseXml(ByVal sParse As String) As String
   Dim i As Long
   Dim iC As Long
   Dim sC As String
   Dim sRet As String
   For i = 1 To Len(sParse)
      sC = Mid(sParse, i, 1)
      iC = AscW(sC)
      If (iC < 32) Or (iC > 127) Then
         sRet = sRet & "&#x" & Hex$(iC) & ";"
      ElseIf (iC = AscW("&")) Then
         sRet = sRet & "&amp;"
      ElseIf (iC = AscW("<")) Then
         sRet = sRet & "&lt;"
      ElseIf (iC = AscW(">")) Then
         sRet = sRet & "&gt;"
      Else
         sRet = sRet & sC
      End If
   Next i
   ParseXml = sRet
End Function