C# Class ExoMerge.Aspose.Common.QuoteCharacters

A class that manages the use of a reference field in place of quote characters.
This behavior may be needed if injecting quote characters into a document during the merge process has unindended side-effects, e.g. corrupting IF fields.
Show file Open project: vc3/ExoMerge

Public Methods

Method Description
ConvertToFieldReferences ( Document document, Node node, Node &nodes ) : bool

Convert quotes in the given node to instead use the quote field reference.

EnsureQuoteField ( Document document ) : void

Ensure that the quote field is present at the start of the given document.

IsQuoteField ( FieldStart start ) : bool

Determines if the given field start is the quote reference field.

IsQuoteField ( FieldStart start, FieldEnd &end ) : bool

Determines if the given field start is the quote reference field and returns its field end if so.

TryReplaceFancyQuotes ( string text, string &newText ) : bool

Attempts to replace balanced fancy quotes with standard quotes.

Private Methods

Method Description
ConvertToFieldReferences ( Document document, Node node ) : bool

Convert quotes in the given node to instead use the quote field reference.

ConvertToFieldReferences ( Document document, Run run, Node &nodes ) : bool

Convert quotes in the given node to instead use the quote field reference.

GetReferenceFieldContainer ( Document document ) : CompositeNode

Gets the container for the quote field: the first paragraph in the document.

HasQuotes ( string text, int startIndex, int &indexOfStandardQuote, int &indexOfFancyQuote ) : bool

Attempts to find the next indices of the standard, fancy left, and fancy right quote characters in the given string.

HasQuotes ( string text, int startIndex, int &indexOfStandardQuote, int &indexOfFancyLeftQuote, int &indexOfFancyRightQuote ) : bool

Attempts to find the next indices of the standard, fancy left, and fancy right quote characters in the given string.

SafeSubstring ( string str, int startIndex, int length ) : string

Enhances the built-in substring method by account for out-of-bounds conditions.

Method Details

ConvertToFieldReferences() public static method

Convert quotes in the given node to instead use the quote field reference.
public static ConvertToFieldReferences ( Document document, Node node, Node &nodes ) : bool
document Document
node Node
nodes Node
return bool

EnsureQuoteField() public static method

Ensure that the quote field is present at the start of the given document.
public static EnsureQuoteField ( Document document ) : void
document Document
return void

IsQuoteField() public static method

Determines if the given field start is the quote reference field.
public static IsQuoteField ( FieldStart start ) : bool
start FieldStart
return bool

IsQuoteField() public static method

Determines if the given field start is the quote reference field and returns its field end if so.
public static IsQuoteField ( FieldStart start, FieldEnd &end ) : bool
start FieldStart
end FieldEnd
return bool

TryReplaceFancyQuotes() public static method

Attempts to replace balanced fancy quotes with standard quotes.
public static TryReplaceFancyQuotes ( string text, string &newText ) : bool
text string
newText string
return bool