CkMessageSet Ruby Programming
Reference Documentation

CkMessageSet

Represents a collection of email message sequence numbers or UIDs on an IMAP server.

Properties

# Returns an integer value
get_Count( )

The number of message UIDs (or sequence numbers) in this message set.

# Returns a boolean value
get_HasUids( )

# value is a boolean (input)
put_HasUids( value )

If true then the message set contains UIDs, otherwise it contains sequence numbers.

Methods

# msgId is an integer (input)
# Returns a boolean value
ContainsId( msgId )

Returns true if the msgId is contained in the message set.

# str is a string (input)
# Returns a boolean value
FromCompactString( str )

Loads the message set from a compact-string representation. Here are some examples:

Non-Compact String

Compact String

1,2,3,4,5

1:5

1,2,3,4,5,8,9,10

1:5,8:10

1,3,4,5,8,9,10

1,3:5,8:10

# index is an integer (input)
# Returns an integer value
GetId( index )

Returns the message ID of the Nth message in the set. (indexing begins at 0). Returns -1 if the index is out of range.

# id is an integer (input)
InsertId( id )

Inserts a message ID into the set. If the ID already exists, a duplicate is not inserted.

# id is an integer (input)
RemoveId( id )

Removes a message ID from the set.

# outStr is a CkString object (output)
# Returns a boolean value
ToCompactString( outStr )

Returns the set of message IDs represented as a compact string. Here are some examples:

Non-Compact String

Compact String

1,2,3,4,5

1:5

1,2,3,4,5,8,9,10

1:5,8:10

1,3,4,5,8,9,10

1,3:5,8:10

# str is a CkString object (output)
ToString( str )

Returns a string of comma-separated message IDs. (This is the non-compact string format.)

# Returns a string
toCompactString( )

Returns the set of message IDs represented as a compact string. Here are some examples:

Non-Compact String

Compact String

1,2,3,4,5

1:5

1,2,3,4,5,8,9,10

1:5,8:10

1,3,4,5,8,9,10

1,3:5,8:10

# Returns a string
toString( )

Returns a string of comma-separated message IDs. (This is the non-compact string format.)