Class TcStringParser
Provides functionality to parse TC Strings.
public class TcStringParser
Fields
specialFeatureLookup
protected readonly Dictionary<int, Feature> specialFeatureLookup
purposeLookup
protected readonly Dictionary<int, Purpose> purposeLookup
vendorLookup
protected readonly Dictionary<int, Vendor> vendorLookup
Methods
Parse(string)
Parses the given string value into a TcString
object.
public TcString Parse(string value)
Returns
Bidtellect.Tcf.Models.TcString: A model which represents the given value when parsed.
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to be parsed. |
Parse(string, ParseOptions)
Parses the given string value into a TcString
object.
public TcString Parse(string value, TcStringParser.ParseOptions options)
Returns
Bidtellect.Tcf.Models.TcString: A model which represents the given value when parsed.
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to be parsed. |
Bidtellect.Tcf.Serialization.TcStringParser.ParseOptions | options | Parse options. |
Parse(string, TcString, ParseOptions)
protected void Parse(string value, TcString tcString, TcStringParser.ParseOptions options)
Parameters
Type | Name |
---|---|
System.String | value |
Bidtellect.Tcf.Models.TcString | tcString |
Bidtellect.Tcf.Serialization.TcStringParser.ParseOptions | options |
ParseCore(string, TcString, ParseOptions)
protected void ParseCore(string value, TcString tcString, TcStringParser.ParseOptions options)
Parameters
Type | Name |
---|---|
System.String | value |
Bidtellect.Tcf.Models.TcString | tcString |
Bidtellect.Tcf.Serialization.TcStringParser.ParseOptions | options |
ParseDisclosedVendors(string, TcString, ParseOptions)
protected void ParseDisclosedVendors(string value, TcString tcString, TcStringParser.ParseOptions options)
Parameters
Type | Name |
---|---|
System.String | value |
Bidtellect.Tcf.Models.TcString | tcString |
Bidtellect.Tcf.Serialization.TcStringParser.ParseOptions | options |
ParsePublisherTc(string, TcString, ParseOptions)
protected void ParsePublisherTc(string value, TcString tcString, TcStringParser.ParseOptions options)
Parameters
Type | Name |
---|---|
System.String | value |
Bidtellect.Tcf.Models.TcString | tcString |
Bidtellect.Tcf.Serialization.TcStringParser.ParseOptions | options |
ReadVersion(BitReader)
protected virtual int ReadVersion(BitReader reader)
Returns
System.Int32
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
ReadBitField(BitReader, int)
protected virtual IEnumerable<KeyValuePair<int, bool>> ReadBitField(BitReader reader, int length)
Returns
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32,System.Boolean>>
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
System.Int32 | length |
ReadSpecialFeatures(BitReader)
protected virtual FeatureCollection ReadSpecialFeatures(BitReader reader)
Returns
Bidtellect.Tcf.Models.Components.VendorList.FeatureCollection
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
ReadPurposes(BitReader, int)
protected virtual PurposeCollection ReadPurposes(BitReader reader, int length)
Returns
Bidtellect.Tcf.Models.Components.VendorList.PurposeCollection
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
System.Int32 | length |
ReadCustomPurpose(BitReader, int)
protected virtual PurposeCollection ReadCustomPurpose(BitReader reader, int length)
Returns
Bidtellect.Tcf.Models.Components.VendorList.PurposeCollection
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
System.Int32 | length |
ReadVendors(BitReader)
protected virtual VendorCollection ReadVendors(BitReader reader)
Returns
Bidtellect.Tcf.Models.Components.VendorList.VendorCollection
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
ReadVendorBitField(BitReader, int, VendorCollection)
protected virtual void ReadVendorBitField(BitReader reader, int length, VendorCollection collection)
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
System.Int32 | length |
Bidtellect.Tcf.Models.Components.VendorList.VendorCollection | collection |
ReadVendorRange(BitReader, VendorCollection)
protected virtual void ReadVendorRange(BitReader reader, VendorCollection collection)
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
Bidtellect.Tcf.Models.Components.VendorList.VendorCollection | collection |
AddVendor(VendorCollection, int)
protected virtual void AddVendor(VendorCollection collection, int vendorId)
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Models.Components.VendorList.VendorCollection | collection |
System.Int32 | vendorId |
AddVendorRange(VendorCollection, int, int)
protected virtual void AddVendorRange(VendorCollection collection, int startVendorId, int endVendorId)
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Models.Components.VendorList.VendorCollection | collection |
System.Int32 | startVendorId |
System.Int32 | endVendorId |
ReadVendorRangeCount(BitReader)
protected virtual int ReadVendorRangeCount(BitReader reader)
Returns
System.Int32
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
ReadVendorId(BitReader)
protected virtual int ReadVendorId(BitReader reader)
Returns
System.Int32
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
ReadLetters(BitReader, int, int)
protected virtual string ReadLetters(BitReader reader, int count, int length)
Returns
System.String
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
System.Int32 | count |
System.Int32 | length |
ReadPublisherRestrictions(BitReader)
protected virtual PublisherRestrictionCollection ReadPublisherRestrictions(BitReader reader)
Returns
Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestrictionCollection
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
GetItemFromLookup<TKey, TValue>(TKey, IDictionary<TKey, TValue>)
protected virtual TValue GetItemFromLookup<TKey, TValue>(TKey key, IDictionary<TKey, TValue> lookup)
Returns
<TValue>
Parameters
Type | Name |
---|---|
<TKey> | key |
System.Collections.Generic.IDictionary<<TKey>,<TValue>> | lookup |
Type Parameters
TKey
TValue
GetPurpose(int)
protected virtual Purpose GetPurpose(int purposeId)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Purpose
Parameters
Type | Name |
---|---|
System.Int32 | purposeId |
GetSpecialFeature(int)
protected virtual Feature GetSpecialFeature(int featureId)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Feature
Parameters
Type | Name |
---|---|
System.Int32 | featureId |
GetVendor(int)
protected virtual Vendor GetVendor(int vendorId)
Returns
Bidtellect.Tcf.Models.Components.VendorList.Vendor
Parameters
Type | Name |
---|---|
System.Int32 | vendorId |
CreateBitReader(string)
protected static BitReader CreateBitReader(string base64String)
Returns
Bidtellect.Tcf.Serialization.BitReader
Parameters
Type | Name |
---|---|
System.String | base64String |
ReadEpoch(BitReader, int)
protected static DateTime ReadEpoch(BitReader reader, int length)
Returns
System.DateTime
Parameters
Type | Name |
---|---|
Bidtellect.Tcf.Serialization.BitReader | reader |
System.Int32 | length |
GetSegmentType(string)
protected static SegmentType GetSegmentType(string unparsedSection)
Returns
Bidtellect.Tcf.Models.Components.ConsentString.SegmentType
Parameters
Type | Name |
---|---|
System.String | unparsedSection |