CkData ActiveX Reference (Visual Basic)

CkData

Represents a chunk of byte data and provides methods for accessing it, adding to it, or retrieving it in various encoded forms such as Base64 or quoted-printable.

Reference Index
Chilkat Home
CreateObject
Example Programs

Properties

Base64LineLength
ContentType
Crlf
Description
Filename
LastErrorHtml
LastErrorText
LastErrorXml
NumBytes
Version

Methods

AppendString
GetBase64
GetBinary
GetByte
GetChunk
GetHex
GetHtmlEscapedQP
GetLong
GetLongBigEndian
GetQuotedPrintable
GetString
GetSubString
GetUWordBigEndian
GetUnsignedByte
GetUnsignedWord
GetWord
GetWordBigEndian
HtmlEscape
LoadBase64
LoadBinary
LoadFile
LoadQuotedPrintable
LoadString
PrependString
SaveToFile
SaveToTempFile

Properties

Base64LineLength As Long

The line-length used when encoding to base-64 format.

ContentType As String

A user-defined property allowing an application to keep content-type information with the data.

Crlf As Long

When set to 1, CRLF line endings are used when the data is returned as a string, otherwise bare LF line endings are used.

Description As String

A user-defined property allowing a description to accompany the data.

Filename As String

This property is set by the LoadFile and SaveToFile methods. It is useful for applications to know where the data originated.

LastErrorHtml As String (read-only)

Error information in HTML format for the last method called.

LastErrorText As String (read-only)

Error information in plain-text format for the last method called.

LastErrorXml As String (read-only)

Error information in XML format for the last method called.

NumBytes As Long (read-only)

Number of bytes contained in the CkData object.

Version As String (read-only)

The version of the object, such as "2.1.0".

Methods

AppendString(str As String)

Appends a string to the data. The parameter is a Unicode string that is implicitly converted to an ANSI multibyte string before appending.

GetBase64() As String

Return the data in a Base-64 encoded string.

GetBinary() As Variant

Return the binary data as an array of bytes (in a Variant).

GetByte(index As Long) As Long

Returns the Nth byte in the data.

GetChunk(fromIndex As Long, numBytes As Long) As Variant

Return a chunk of binary data. The first byte is at index 0.

GetHex() As String

Returns the hex-string representation of the data contained within the CkData object.

GetHtmlEscapedQP() As String

Returns the binary data as HTML-escaped quoted-printable.

GetLong(index As Long) As Long

Returns the 4-byte integer located at a byte-offset within the data. It assumes little-endian byte ordering.

GetLongBigEndian(index As Long) As Long

Returns the 4-byte integer located at a byte-offset within the data. It assumes big-endian byte ordering.

GetQuotedPrintable() As String

Returns the binary data in a quoted-printable formatted string.

GetString() As String

Returns the data as a Unicode string. The data is assumed to be ANSI character data and is implicitly converted to Unicode. Also, line endings are converted to CRLFs or LFs according to the Crlf property.

GetSubString(index As Long, numChars As Long) As String

Same as GetString, except a sub-string of the data is returned.

GetUWordBigEndian(index As Long) As Long

Returns the big-endian 16-bit word located at a specified byte offset in the data.

GetUnsignedByte(index As Long) As Long

Returns the Nth byte of data as an unsigned byte (0-255). The first byte is at index 0.

GetUnsignedWord(index As Long) As Long

Returns the little-endian 16-bit word located at a specified byte offset in the data.

GetWord(index As Long) As Long

Returns the little-endian 16-bit signed word located at a specified byte offset in the data.

GetWordBigEndian(index As Long) As Long

Returns the big-endian 16-bit signed word located at a specified byte offset in the data.

HtmlEscape(htmlString As String) As String

Returns the data as an HTML-escaped string.

LoadBase64(base64Data As String)

Decodes from a Base64 formatted string and loads the data.

LoadBinary(binaryData As Variant)

Copies binary data into the object, replacing what data may have already been present.

LoadFile(filename As String) As Long

Opens a file for binary read and copies the entire file into the object, replacing whatever data might have already been present.

LoadQuotedPrintable(qpText As String)

Decodes a quoted-printable string and copies the binary data into the object, replacing whatever data may have already been present.

LoadString(textData As String)

Loads a string into the object, replacing the data that may have been present. The input argument, a Unicode string, is implicitly converted to a multibyte ANSI string.

PrependString(str As String)

Same as LoadString, except the string is prepended to the existing data instead of replacing it.

SaveToFile(filename As String) As Long

Saves the data to a file. The file is created if it does not already exist, and overwritten if it does.

SaveToTempFile(templateFilename As String) As String

Same as SaveToFile, except a temporary file is created based on the filename prefix passed in the argument. The name of the file created is returned.

Copyright 2000-2006 Chilkat Software, Inc.