DisplayTextFormatterSupport
Overview
DisplayTextFormatterSupport is a class in Aspose.Cells FOSS for C++.
Internal helper methods for display-text formatting of numeric, text, and date/time values.
Methods
| Signature | Description |
|---|---|
SelectNumericSection(sections: std::vector<DisplayFormatSectionInfo>, numericValue: double, useAbsoluteValue: bool) → std::optional<DisplayFormatSectionInfo> | Selects the appropriate numeric section from a parsed format code. Returns std::nullopt when sections is empty. |
SelectTextSection(sections: std::vector<DisplayFormatSectionInfo>) → std::optional<DisplayFormatSectionInfo> | Selects the text section (fourth section, or first containing ‘@’). Returns std::nullopt if no text section is found. |
SelectDateTimeSection(sections: std::vector<DisplayFormatSectionInfo>) → std::optional<DisplayFormatSectionInfo> | Selects the first non-empty date/time section (among the first three). Returns std::nullopt if all are blank. |
ParseSections(formatCode: std::string_view) → std::vector<DisplayFormatSectionInfo> | Parses a format code into section descriptors. |
SplitSections(formatCode: std::string_view) → std::vector<std::string> | Splits a format code on unquoted, unescaped semicolons. |
TryParseSectionCondition(section: std::string_view, conditionOperator: std::string, conditionValue: double) → bool | Attempts to parse a condition (operator + value) from a section string. |
TryParseConditionToken(token: std::string_view, conditionOperator: std::string, conditionValue: double) → bool | Attempts to parse a condition token such as “>=10”. |
EvaluateCondition(conditionOperator: std::string_view, numericValue: double, conditionValue: double) → bool | Evaluates a comparison between numericValue and conditionValue. |
ShouldUseAbsoluteValue(section: std::string_view, numericValue: double) → bool | Determines whether the absolute value of a negative number should be used when formatting (i.e. the pattern has no explicit ‘-’ sign). |
SanitizeNumericSection(section: std::string_view) → std::string | Strips directive brackets, quote escapes, and placeholder characters from a numeric section, returning the cleaned string (edge-trimmed). |
StripDirectiveBrackets(section: std::string_view, preserveElapsedTokens: bool) → std::string | Removes bracketed directive tokens from a section string. |
ContainsNumericPlaceholder(pattern: std::string_view) → bool | Returns true if the pattern contains any numeric placeholder character. |
ExpandSectionPattern(pattern: std::string_view, valueText: std::string_view, replaceTextPlaceholder: bool) → std::string | Expands a section pattern by replacing text placeholders and removing formatting escapes. |
IsNumericValue(value: CellValue) → bool | Returns true if the CellValue holds a numeric type (int or double). |
ConvertToDouble(value: CellValue) → double | Converts a numeric CellValue to double. Throws std::invalid_argument if the value is not numeric. |
GetAbsoluteNumericValue(value: CellValue) → CellValue | Returns the absolute numeric value. Non-numeric values are returned unchanged. |