cfc81dba 5c4a 2770 9cf7 5c44ffbf7121 - akesseler/Plexdata.CsvParser GitHub Wiki

CsvContainer Class

This class serves as container for the content of CSV data.

Inheritance Hierarchy

System.Object
  Plexdata.CsvParser.Processors.CsvContainer
Namespace: Plexdata.CsvParser.Processors
Assembly: Plexdata.CsvParser.NET (in Plexdata.CsvParser.NET.dll) Version: 1.1.3+d5bef99aa35461ce4bafadf0bf2c2aeca18044ea

Syntax

C#

public class CsvContainer

The CsvContainer type exposes the following members.

Constructors

 

Name Description
Protected method CsvContainer() The default class constructor.
Public method CsvContainer(List(List(String))) The constructor with content initialization.
Public method CsvContainer(List(List(String)), CsvSettings) The constructor with content initialization.
Public method CsvContainer(Int32, Int32) The constructor with table initialization.
Public method CsvContainer(Int32, Int32, CsvSettings) The constructor with table initialization.
  Back to Top

Properties

 

Name Description
Public property Compare Gets and sets the algorithm how any string comparison has to be done. Default value is OrdinalIgnoreCase.
Public property Content Gets the currently used CSV content.
Public property Culture Gets currently applied culture. Default value is current UI culture.
Public property Exactly Determines if the exactly mode is enabled or disabled. Default value is false.
Public property Heading Determines if the header usage is enabled or disabled. Default value is false.
Public property IsEmpty Indicates whether this container instance is empty or not.
Public property Item(Int32) Gets and sets the list of column items at specified position.
Public property Item(String) Gets and sets the list of column items for provided header.
Public property Item(Int32, Int32) Gets and sets an element for provided column and at specified index.
Public property Item(String, Int32) Gets and sets an element for provided header and at specified index.
Public property Length Gets the length (total number of rows) of the content.
Public property Mappings Gets currently applied value mappings. Default value is standard mapping.
Public property Width Gets the width (total number of columns) of the content.
  Back to Top

Methods

 

Name Description
Private method ChangeColumn Changes the whole content of affected column.
Public method Contains Determines whether a particular header is in the container.
Private methodStatic member CreateDefaultSettings Creates an instance of class CsvSettings and initializes it with relevant default values.
Private methodStatic member CreateInitialContent Creates an initial content according to provided width and length.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetColumnIndex This method tries to determine the column for provided header.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Private method GetObject This method simply tries to convert provided string into its expected object representation.
Public method GetTransformedContent Gets the transformed content of this container.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValue(Int32, Int32, Type) This method gets the type-save value for provided column and at specified index taking provide type into account.
Public method GetValue(String, Int32, Type) This method gets the type-save value for provided header and at specified index taking provide type into account.
Public method GetValue(TType)(Int32, Int32) This method gets the type-save value for provided column and at specified index.
Public method GetValue(TType)(String, Int32) This method gets the type-save value for provided header and at specified index.
Private method IsValid Determines whether source list is valid.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetValue(Object, Int32, Int32) Sets provided value at field referenced by column and index.
Public method SetValue(Object, String, Int32) Sets provided value at field referenced by header and index.
Public method SetValue(TType)(TType, Int32, Int32) Sets provided value of type TType at field referenced by column and index.
Public method SetValue(TType)(TType, String, Int32) Sets provided value of type TType at field referenced by header and index.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Private methodCode example Transform This method transforms line-oriented content into its column-oriented representation.
Public method TryGetValue(Int32, Int32, Type) This method tries to get the type-save value for provided column an at specified index taking provide type into account.
Public method TryGetValue(String, Int32, Type) This method tries to get the type-save value for provided header an at specified index taking provide type into account.
Public method TryGetValue(TType)(Int32, Int32) This method tries to get the type-save value for provided column an at specified index.
Public method TryGetValue(TType)(String, Int32) This method tries to get the type-save value for provided header an at specified index.
Public method TrySetValue(Object, Int32, Int32) Tries to set provided value at field referenced by column and index.
Public method TrySetValue(Object, String, Int32) Tries to set provided value at field referenced by header and index.
Public method TrySetValue(TType)(TType, Int32, Int32) Tries to set provided value of type TType at field referenced by column and index.
Public method TrySetValue(TType)(TType, String, Int32) Tries to set provided value of type TType at field referenced by header and index.
  Back to Top

Extension Methods

 

Name Description
Private Extension Method GetColumn Gets the zero-based index of a column that is referenced by provided header. (Defined by CsvContainerExtension.)
Public Extension Method Serialize() Overloaded.
Serializes the content of provided CsvContainer into a string. (Defined by CsvContainerExtension.)
Public Extension Method Serialize(CsvSettings) Overloaded.
Serializes the content of provided CsvContainer into a string using provided settings. (Defined by CsvContainerExtension.)
Public Extension Method Sort(String, SortOrder) Overloaded.
Sorts the container by column referenced by provided header and in provided sort order. (Defined by CsvContainerExtension.)
Public Extension Method Sort(Int32, SortOrder) Overloaded.
Sorts the container by referenced column and in provided sort order. (Defined by CsvContainerExtension.)
  Back to Top

Remarks

Additionally, this class provides methods to access their items as well as converts values into their expected data type.

See Also

Reference

Plexdata.CsvParser.Processors Namespace

⚠️ **GitHub.com Fallback** ⚠️