Diffusion .NET Client Library
6.1.5
|
Builds content in record format. More...
Public Member Functions | |
IRecordContentBuilder | PutRecord (params string[] fields) |
Puts a single record comprising zero or more fields into the content. More... | |
IRecordContentBuilder | PutRecord (ICollection fields) |
Puts a single record comprising zero or more fields into the content. More... | |
IRecordContentBuilder | PutRecords (params IRecord[] records) |
Puts records into the content. More... | |
IRecordContentBuilder | PutRecords (ICollection< IRecord > records) |
Puts records into the content. More... | |
IRecordContentBuilder | PutFields (params string[] fields) |
Puts fields into the content. More... | |
IRecordContentBuilder | PutFields (ICollection< object > fields) |
Puts fields into the content. More... | |
Public Member Functions inherited from PushTechnology.ClientInterface.Client.Content.IContentBuilder< out TB > | |
TB | SetEncoding (ContentEncoding encoding) |
/// Sets the transport encoding to be used for the content. More... | |
TB | Reset () |
Reset the builder, clearing all that has been added to it so far. This will also reset any other attributes of the content to initial default values. More... | |
IContent | Build () |
Build content. More... | |
Builds content in record format.
Such a builder can be created using IContentFactory.NewBuilder{TB}.
Record format is defined as being character string fields separated using special delimiter bytes which could not occur in a normal character string. This builder will insert all types of delimiter automatically and so there is no need to write any delimiters manually.
The builder allows data to be put into content relative to the start position and then Build() is finally used to build immutable content. The builder may then be Reset() and reused if required.
Strings are converted to byte format for transport using the charset of the builder. By default UTF8 is used.
Note that record format has no concept of null and if null values are specified to any of the methods then they are written as empty fields.
The following description of record format is for information only:
Records are separated using Constants.RECORD_DELIMITER and fields within records are separated using Constants.FIELD_DELIMITER.
A field may be empty (i.e. a zero-length string), as may a record (i.e. having no fields).
A record delimiter should not be used at the start of the first record or the end of the last record as these would imply an empty leading or trailing record respectively.
Also, a field delimiter should not be used before the first field within a record or after the last field within a record, as in both cases an empty field would be implied.
This presents certain problems of representation as it would not be possible to distinguish between empty content and content containing a single empty record. Equally, it would not be possible to distinguish between an empty record and one containing a single empty field. To overcome this there are two special delimiters, the Constants.RECORD_MU and the Constants.FIELD_MU. The record mu can be used as the only byte within content to represent a single empty record and the field mu can be used as the only byte within a record to represent a record with a single empty field.
IRecordContentBuilder PushTechnology.ClientInterface.Client.Content.IRecordContentBuilder.PutFields | ( | params string[] | fields | ) |
Puts fields into the content.
fields | If there are already records in the content then the fields will be added to the last record. |
IRecordContentBuilder PushTechnology.ClientInterface.Client.Content.IRecordContentBuilder.PutFields | ( | ICollection< object > | fields | ) |
Puts fields into the content.
If there are already records in the content then the fields will be added to the last record.
fields | The collection of field objects. The ToString() method of each object will be used to generate the string value of the field. Null values are interpreted as empty fields. |
IRecordContentBuilder PushTechnology.ClientInterface.Client.Content.IRecordContentBuilder.PutRecord | ( | params string[] | fields | ) |
Puts a single record comprising zero or more fields into the content.
fields | One or more string fields. Any null value will be written as an empty field. |
IRecordContentBuilder PushTechnology.ClientInterface.Client.Content.IRecordContentBuilder.PutRecord | ( | ICollection | fields | ) |
Puts a single record comprising zero or more fields into the content.
fields | A collection of objects from which the string field values will be obtained. Any null value is interpreted as an empty field. If this is supplied as null then an empty record will be written. |
IRecordContentBuilder PushTechnology.ClientInterface.Client.Content.IRecordContentBuilder.PutRecords | ( | params IRecord[] | records | ) |
Puts records into the content.
records | The records - zero or more can be specified. Null entries are interpreted as empty records. |
IRecordContentBuilder PushTechnology.ClientInterface.Client.Content.IRecordContentBuilder.PutRecords | ( | ICollection< IRecord > | records | ) |
Puts records into the content.
records | A Collection of records. If this is null then nothing will be written. Null entries are interpreted as empty records. |