Class OperationPtg
This class is the base class for all operation tokens in the formula.
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Parser.Biff_Records.Formula
Assembly: Syncfusion.XlsIO.Portable.dll
Syntax
public abstract class OperationPtg : Ptg, ICloneable
Constructors
OperationPtg()
Default constructor.
Declaration
public OperationPtg()
OperationPtg(DataProvider, Int32, ExcelVersion)
Creates operation from byte array and offset in this array.
Declaration
protected OperationPtg(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. |
Properties
Attributes
Array of all token attributes applied to the object. This property is used to increase performance.
Declaration
protected abstract TokenAttribute[] Attributes { get; }
Property Value
Type |
---|
TokenAttribute[] |
IsOperation
Read-only. True if this class represents operation (always True for this class).
Declaration
public override bool IsOperation { get; }
Property Value
Type |
---|
System.Boolean |
Overrides
IsPlaceAfter
Gets / sets True if operation sign should be placed after operand and False otherwise.
Declaration
public bool IsPlaceAfter { get; set; }
Property Value
Type |
---|
System.Boolean |
NumberOfOperands
Read-only. Number of operands this operation needs.
Declaration
public virtual int NumberOfOperands { get; }
Property Value
Type |
---|
System.Int32 |
OperationSymbol
Gets / sets string representation of the operation.
Declaration
public string OperationSymbol { get; set; }
Property Value
Type |
---|
System.String |
OperationType
Read-only. Type of the operation.
Declaration
public abstract TOperation OperationType { get; }
Property Value
Type |
---|
TOperation |
Methods
GetOperands(String, ref Int32, FormulaUtil)
Returns array of string where each member corresponds to one argument.
Declaration
public abstract string[] GetOperands(string strFormula, ref int index, FormulaUtil formulaParser)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFormula | String representation of the formula. |
System.Int32 | index | Index of the operation. |
FormulaUtil | formulaParser | Formula parser. |
Returns
Type | Description |
---|---|
System.String[] | Array of strings containing operation operands. |
GetOperandsSeparator(FormulaUtil)
Returns arguments separator.
Declaration
protected string GetOperandsSeparator(FormulaUtil formulaUtil)
Parameters
Type | Name | Description |
---|---|---|
FormulaUtil | formulaUtil | FormulaUtil object, to get separator from. |
Returns
Type | Description |
---|---|
System.String | Arguments separator. |
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 abstract 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 |
PushResultToStack(Stack<Object>)
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 virtual void PushResultToStack(Stack<object> operands)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Stack<System.Object> | operands | Stack that contains all operands and receives result of the operation. |
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. |
Overrides
UpdateParseOptions(ExcelParseFormulaOptions)
Updates parse formula options if necessary.
Declaration
public virtual ExcelParseFormulaOptions UpdateParseOptions(ExcelParseFormulaOptions options)
Parameters
Type | Name | Description |
---|---|---|
ExcelParseFormulaOptions | options | Options to update. |
Returns
Type | Description |
---|---|
ExcelParseFormulaOptions | Updated value. |