Class FunctionPtg
This class represents function token of a formula.
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Parser.Biff_Records.Formula
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
[Token(FormulaToken.tFunction2)]
[Token(FormulaToken.tFunction3)]
[CLSCompliant(false)]
[Token(FormulaToken.tFunction1)]
public class FunctionPtg : OperationPtg, ICloneable
Constructors
FunctionPtg()
Default constructor
Declaration
public FunctionPtg()
FunctionPtg(ExcelFunction)
Constructs token by function index.
Declaration
public FunctionPtg(ExcelFunction index)
Parameters
Type | Name | Description |
---|---|---|
ExcelFunction | index | Function index. |
FunctionPtg(DataProvider, Int32, ExcelVersion)
Constructs token using data from byte array.
Declaration
public FunctionPtg(DataProvider provider, int offset, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
DataProvider | provider | Object that provides access to the data. |
System.Int32 | offset | Offset to token data. |
ExcelVersion | version | Excel version that was used to infill data provider. |
FunctionPtg(String)
Constructs function token by function name.
Declaration
public FunctionPtg(string strFunctionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFunctionName | Valid function name. |
Fields
OperandsDelimiter
Delimiter between function arguments.
Declaration
public const string OperandsDelimiter = ","
Field Value
Type |
---|
System.String |
Properties
Attributes
Array of all token attributes applied to the object. This property is used to increase performance.
Declaration
protected override TokenAttribute[] Attributes { get; }
Property Value
Type |
---|
TokenAttribute[] |
Overrides
FunctionIndex
Returns built-in function index.
Declaration
public ExcelFunction FunctionIndex { get; set; }
Property Value
Type |
---|
ExcelFunction |
NumberOfArguments
Number of function arguments.
Declaration
public byte NumberOfArguments { get; set; }
Property Value
Type |
---|
System.Byte |
OperationType
Read-only. Type of operation (TYPE_FUNCTION for all functions).
Declaration
public override TOperation OperationType { get; }
Property Value
Type |
---|
TOperation |
Overrides
Methods
GetOperands(String, ref Int32, FormulaUtil)
Gets operands from string and returns array of string representation of the operands.
Declaration
public override string[] GetOperands(string strFormula, ref int index, FormulaUtil formulaParser)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFormula | Formula string. |
System.Int32 | index | Index of the function in the formula string. |
FormulaUtil | formulaParser | Formula parser. |
Returns
Type | Description |
---|---|
System.String[] | Array of strings that contains function operands. |
Overrides
GetOperands(String, ref Int32, Boolean, FormulaUtil)
Gets operands from string and returns array of string representation of the operands.
Declaration
protected string[] GetOperands(string strFormula, ref int index, bool checkParamCount, FormulaUtil formulaParser)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFormula | Formula string. |
System.Int32 | index | Index to built-in function. |
System.Boolean | checkParamCount | True if function should check operands count. |
FormulaUtil | formulaParser | Formula parser. |
Returns
Type | Description |
---|---|
System.String[] | Array of strings that contain function operands. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | if checkParamCount = True and actual parameter count does not equal expected |
GetSize(ExcelVersion)
Read-only. Size of the token.
Declaration
public override int GetSize(ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
ExcelVersion | version |
Returns
Type |
---|
System.Int32 |
Overrides
IndexToCode(Int32)
Declaration
public static FormulaToken IndexToCode(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
FormulaToken |
InfillPTG(DataProvider, ref Int32, ExcelVersion)
Infill PTG structure.
Declaration
public override void InfillPTG(DataProvider provider, ref int offset, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
DataProvider | provider | Represents storage. |
System.Int32 | offset | Offset in storage. |
ExcelVersion | version | Excel version that was used to infill data provider. |
Overrides
PushResultToStack(FormulaUtil, Stack<Object>, Boolean)
Converts the operation and its operands to the string. Gets all needed operands from the Stack parameter and pushes the result into the Stack.
Declaration
public override void PushResultToStack(FormulaUtil formulaUtil, Stack<object> operands, bool isForSerialization)
Parameters
Type | Name | Description |
---|---|---|
FormulaUtil | formulaUtil | Object used for formula parsing. |
System.Collections.Generic.Stack<System.Object> | operands | Stack that contains all operands and receives result of the operation. |
System.Boolean | isForSerialization |
Overrides
ToByteArray(ExcelVersion)
Converts token to byte array.
Declaration
public override byte[] ToByteArray(ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
ExcelVersion | version |
Returns
Type | Description |
---|---|
System.Byte[] | Array of bytes representing this token. |
Overrides
ToString(FormulaUtil, Int32, Int32, Boolean, NumberFormatInfo, Boolean)
Converts token to a string.
Declaration
public override string ToString(FormulaUtil formulaUtil, int iRow, int iColumn, bool bR1C1, NumberFormatInfo numberFormat, bool isForSerialization)
Parameters
Type | Name | Description |
---|---|---|
FormulaUtil | formulaUtil | Formula util. |
System.Int32 | iRow | Zero-based row index of the cell that contains this token. |
System.Int32 | iColumn | Zero-based row index of the cell that contains this token. |
System.Boolean | bR1C1 | Indicates whether R1C1 notation should be used. |
System.Globalization.NumberFormatInfo | numberFormat | |
System.Boolean | isForSerialization |
Returns
Type | Description |
---|---|
System.String | String representation of this token. |