Functions for getting and setting Tidy configuration options.
Option Callback Functions | |
typedef Bool(TIDY_CALL * | TidyOptCallback) (ctmbstr option, ctmbstr value) |
This typedef represents the required signature for your provided callback function should you wish to register one with tidySetOptionCallback(). More... | |
typedef Bool(TIDY_CALL * | TidyConfigCallback) (TidyDoc tdoc, ctmbstr option, ctmbstr value) |
This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigCallback(). More... | |
typedef void(TIDY_CALL * | TidyConfigChangeCallback) (TidyDoc tdoc, TidyOption option) |
This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigChangeCallback(). More... | |
Bool TIDY_CALL | tidySetOptionCallback (TidyDoc tdoc, TidyOptCallback pOptCallback) |
Applications using TidyLib may want to augment command-line and configuration file options. More... | |
Bool TIDY_CALL | tidySetConfigCallback (TidyDoc tdoc, TidyConfigCallback pConfigCallback) |
Applications using TidyLib may want to augment command-line and configuration file options. More... | |
Bool TIDY_CALL | tidySetConfigChangeCallback (TidyDoc tdoc, TidyConfigChangeCallback pCallback) |
Applications using TidyLib may want to be informed when changes to options are made. More... | |
Option ID Discovery | |
TidyOptionId TIDY_CALL | tidyOptGetId (TidyOption opt) |
Get ID of given Option. More... | |
TidyOptionId TIDY_CALL | tidyOptGetIdForName (ctmbstr optnam) |
Returns the TidyOptionId (enum value) by providing the name of a Tidy configuration option. More... | |
Getting Instances of Tidy Options | |
TidyIterator TIDY_CALL | tidyGetOptionList (TidyDoc tdoc) |
Initiates an iterator for a list of TidyOption instances, which allows you to iterate through all of the available options. More... | |
TidyOption TIDY_CALL | tidyGetNextOption (TidyDoc tdoc, TidyIterator *pos) |
Given a valid TidyIterator initiated with tidyGetOptionList(), returns the instance of the next TidyOption. More... | |
TidyOption TIDY_CALL | tidyGetOption (TidyDoc tdoc, TidyOptionId optId) |
Retrieves an instance of TidyOption given a valid TidyOptionId. More... | |
TidyOption TIDY_CALL | tidyGetOptionByName (TidyDoc tdoc, ctmbstr optnam) |
Returns an instance of TidyOption by providing the name of a Tidy configuration option. More... | |
Information About Options | |
ctmbstr TIDY_CALL | tidyOptGetName (TidyOption opt) |
Get name of given Option. More... | |
TidyOptionType TIDY_CALL | tidyOptGetType (TidyOption opt) |
Get datatype of given Option. More... | |
Bool TIDY_CALL | tidyOptionIsList (TidyOption opt) |
Indicates that an option takes a list of items. More... | |
Bool TIDY_CALL | tidyOptIsReadOnly (TidyOption opt) |
Is Option read-only? Some options (mainly internal use only options) are read-only. More... | |
TidyConfigCategory TIDY_CALL | tidyOptGetCategory (TidyOption opt) |
Get category of given Option. More... | |
ctmbstr TIDY_CALL | tidyOptGetDefault (TidyOption opt) |
Get default value of given Option as a string. More... | |
ulong TIDY_CALL | tidyOptGetDefaultInt (TidyOption opt) |
Get default value of given Option as an unsigned integer. More... | |
Bool TIDY_CALL | tidyOptGetDefaultBool (TidyOption opt) |
Get default value of given Option as a Boolean value. More... | |
TidyIterator TIDY_CALL | tidyOptGetPickList (TidyOption opt) |
Initiates an iterator for a list of TidyOption pick-list values, which allows you iterate through all of the available option values. More... | |
ctmbstr TIDY_CALL | tidyOptGetNextPick (TidyOption opt, TidyIterator *pos) |
Given a valid TidyIterator initiated with tidyOptGetPickList(), returns a string representing a possible option value. More... | |
Option Value Functions | |
ctmbstr TIDY_CALL | tidyOptGetValue (TidyDoc tdoc, TidyOptionId optId) |
Get the current value of the option ID for the given document. More... | |
Bool TIDY_CALL | tidyOptSetValue (TidyDoc tdoc, TidyOptionId optId, ctmbstr val) |
Set the option value as a string. More... | |
Bool TIDY_CALL | tidyOptParseValue (TidyDoc tdoc, ctmbstr optnam, ctmbstr val) |
Set named option value as a string, regardless of the TidyOptionType. More... | |
ulong TIDY_CALL | tidyOptGetInt (TidyDoc tdoc, TidyOptionId optId) |
Get current option value as an integer. More... | |
Bool TIDY_CALL | tidyOptSetInt (TidyDoc tdoc, TidyOptionId optId, ulong val) |
Set option value as an integer. More... | |
Bool TIDY_CALL | tidyOptGetBool (TidyDoc tdoc, TidyOptionId optId) |
Get current option value as a Boolean flag. More... | |
Bool TIDY_CALL | tidyOptSetBool (TidyDoc tdoc, TidyOptionId optId, Bool val) |
Set option value as a Boolean flag. More... | |
Bool TIDY_CALL | tidyOptResetToDefault (TidyDoc tdoc, TidyOptionId opt) |
Reset option to default value by ID. More... | |
Bool TIDY_CALL | tidyOptResetAllToDefault (TidyDoc tdoc) |
Reset all options to their default values. More... | |
Bool TIDY_CALL | tidyOptSnapshot (TidyDoc tdoc) |
Take a snapshot of current config settings. More... | |
Bool TIDY_CALL | tidyOptResetToSnapshot (TidyDoc tdoc) |
Apply a snapshot of config settings to a document. More... | |
Bool TIDY_CALL | tidyOptDiffThanDefault (TidyDoc tdoc) |
Any settings different than default? More... | |
Bool TIDY_CALL | tidyOptDiffThanSnapshot (TidyDoc tdoc) |
Any settings different than snapshot? More... | |
Bool TIDY_CALL | tidyOptCopyConfig (TidyDoc tdocTo, TidyDoc tdocFrom) |
Copy current configuration settings from one document to another. More... | |
ctmbstr TIDY_CALL | tidyOptGetEncName (TidyDoc tdoc, TidyOptionId optId) |
Get character encoding name. More... | |
ctmbstr TIDY_CALL | tidyOptGetCurrPick (TidyDoc tdoc, TidyOptionId optId) |
Get the current pick list value for the option ID, which can be useful for enum types. More... | |
TidyIterator TIDY_CALL | tidyOptGetDeclTagList (TidyDoc tdoc) |
Initiates an iterator for a list of user-declared tags, including autonomous custom tags detected in the document if TidyUseCustomTags is not set to no. More... | |
ctmbstr TIDY_CALL | tidyOptGetNextDeclTag (TidyDoc tdoc, TidyOptionId optId, TidyIterator *iter) |
Given a valid TidyIterator initiated with tidyOptGetDeclTagList(), returns a string representing a user-declared or autonomous custom tag. More... | |
TidyIterator TIDY_CALL | tidyOptGetPriorityAttrList (TidyDoc tdoc) |
Initiates an iterator for a list of priority attributes. More... | |
ctmbstr TIDY_CALL | tidyOptGetNextPriorityAttr (TidyDoc tdoc, TidyIterator *iter) |
Given a valid TidyIterator initiated with tidyOptGetPriorityAttrList(), returns a string representing a priority attribute. More... | |
TidyIterator TIDY_CALL | tidyOptGetMutedMessageList (TidyDoc tdoc) |
Initiates an iterator for a list of muted messages. More... | |
ctmbstr TIDY_CALL | tidyOptGetNextMutedMessage (TidyDoc tdoc, TidyIterator *iter) |
Given a valid TidyIterator initiated with tidyOptGetMutedMessageList(), returns a string representing a muted message. More... | |
Option Documentation | |
ctmbstr TIDY_CALL | tidyOptGetDoc (TidyDoc tdoc, TidyOption opt) |
Get the description of the specified option. More... | |
TidyIterator TIDY_CALL | tidyOptGetDocLinksList (TidyDoc tdoc, TidyOption opt) |
Initiates an iterator for a list of options related to a given option. More... | |
TidyOption TIDY_CALL | tidyOptGetNextDocLinks (TidyDoc tdoc, TidyIterator *pos) |
Given a valid TidyIterator initiated with tidyOptGetDocLinksList(), returns a TidyOption instance. More... | |
This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigCallback().
Your callback function will be provided with the following parameters.
tdoc | The document instance for which the callback was invoked. |
option | The option name that was provided. |
value | The option value that was provided |
yes
if it handles the provided option, or no
if it does not. In the latter case, Tidy will issue an unknown configuration option error. typedef void(TIDY_CALL * TidyConfigChangeCallback) (TidyDoc tdoc, TidyOption option) |
This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigChangeCallback().
Your callback function will be provided with the following parameters.
tdoc | The document instance for which the callback was invoked. |
option | The option that will be changed. |
This typedef represents the required signature for your provided callback function should you wish to register one with tidySetOptionCallback().
Your callback function will be provided with the following parameters. Note that this is deprecated and you should instead migrate to tidySetConfigCallback().
option | The option name that was provided. |
value | The option value that was provided |
yes
if it handles the provided option, or no
if it does not. In the latter case, Tidy will issue an unknown configuration option error. TidyOption TIDY_CALL tidyGetNextOption | ( | TidyDoc | tdoc, |
TidyIterator * | pos | ||
) |
Given a valid TidyIterator initiated with tidyGetOptionList(), returns the instance of the next TidyOption.
TidyInternalCategory
; you should never use these. Always ensure that you use tidyOptGetCategory()
before assuming that an option is okay to use in your application. tdoc | The document for which you are retrieving options. |
pos | The TidyIterator (initiated with tidyGetOptionList()) token. |
TidyOption TIDY_CALL tidyGetOption | ( | TidyDoc | tdoc, |
TidyOptionId | optId | ||
) |
Retrieves an instance of TidyOption given a valid TidyOptionId.
tdoc | The document for which you are retrieving the option. |
optId | The TidyOptionId to retrieve. |
TidyOption TIDY_CALL tidyGetOptionByName | ( | TidyDoc | tdoc, |
ctmbstr | optnam | ||
) |
Returns an instance of TidyOption by providing the name of a Tidy configuration option.
optname
. tdoc | The document for which you are retrieving the option. |
optnam | The name of the Tidy configuration option. |
Initiates an iterator for a list of TidyOption instances, which allows you to iterate through all of the available options.
In order to iterate through the available options, initiate the iterator with this function, and then use tidyGetNextOption() to retrieve the first and subsequent options. For example:
tdoc | An instance of a TidyDoc to query. |
Copy current configuration settings from one document to another.
Note that the destination document's existing settings will be stored as that document's snapshot prior to having its option values overwritten by the source document's settings.
tdocTo | The destination tidy document. |
tdocFrom | The source tidy document. |
Any settings different than default?
tdoc | The tidy document to check. |
Any settings different than snapshot?
tdoc | The tidy document to check. |
Bool TIDY_CALL tidyOptGetBool | ( | TidyDoc | tdoc, |
TidyOptionId | optId | ||
) |
Get current option value as a Boolean flag.
tdoc | The tidy document for which to get the value. |
optId | The option ID to get. |
TidyConfigCategory TIDY_CALL tidyOptGetCategory | ( | TidyOption | opt | ) |
Get category of given Option.
opt | An instance of a TidyOption to query. |
ctmbstr TIDY_CALL tidyOptGetCurrPick | ( | TidyDoc | tdoc, |
TidyOptionId | optId | ||
) |
Get the current pick list value for the option ID, which can be useful for enum types.
tdoc | The tidy document to query. |
optId | The option ID whose value to check. |
Initiates an iterator for a list of user-declared tags, including autonomous custom tags detected in the document if TidyUseCustomTags is not set to no.
This iterator allows you to iterate through all of the custom tags. In order to iterate through the tags, initiate the iterator with this function, and then use tidyOptGetNextDeclTag() to retrieve the first and subsequent tags. For example:
tdoc | An instance of a TidyDoc to query. |
ctmbstr TIDY_CALL tidyOptGetDefault | ( | TidyOption | opt | ) |
Get default value of given Option as a string.
opt | An instance of a TidyOption to query. |
Bool TIDY_CALL tidyOptGetDefaultBool | ( | TidyOption | opt | ) |
Get default value of given Option as a Boolean value.
opt | An instance of a TidyOption to query. |
ulong TIDY_CALL tidyOptGetDefaultInt | ( | TidyOption | opt | ) |
Get default value of given Option as an unsigned integer.
opt | An instance of a TidyOption to query. |
ctmbstr TIDY_CALL tidyOptGetDoc | ( | TidyDoc | tdoc, |
TidyOption | opt | ||
) |
Get the description of the specified option.
tdoc | The tidy document to query. |
opt | The option ID of the option. |
TidyIterator TIDY_CALL tidyOptGetDocLinksList | ( | TidyDoc | tdoc, |
TidyOption | opt | ||
) |
Initiates an iterator for a list of options related to a given option.
This iterator allows you to iterate through all of the related options, if any. In order to iterate through the options, initiate the iterator with this function, and then use tidyOptGetNextDocLinks() to retrieve the first and subsequent options. For example:
tdoc | The tidy document to query. |
opt | The option whose related options you wish to find. |
ctmbstr TIDY_CALL tidyOptGetEncName | ( | TidyDoc | tdoc, |
TidyOptionId | optId | ||
) |
Get character encoding name.
Used with TidyCharEncoding, TidyOutCharEncoding, and TidyInCharEncoding.
tdoc | The tidy document to query. |
optId | The option ID whose value to check. |
TidyOptionId TIDY_CALL tidyOptGetId | ( | TidyOption | opt | ) |
Get ID of given Option.
opt | An instance of a TidyOption to query. |
TidyOptionId TIDY_CALL tidyOptGetIdForName | ( | ctmbstr | optnam | ) |
Returns the TidyOptionId (enum value) by providing the name of a Tidy configuration option.
optnam | The name of the option ID to retrieve. |
optname
. ulong TIDY_CALL tidyOptGetInt | ( | TidyDoc | tdoc, |
TidyOptionId | optId | ||
) |
Get current option value as an integer.
tdoc | The tidy document for which to get the value. |
optId | The option ID to get. |
Initiates an iterator for a list of muted messages.
This iterator allows you to iterate through all of the priority attributes defined with the mute
configuration option. In order to iterate through the list, initiate with this function, and then use tidyOptGetNextMutedMessage() to retrieve the first and subsequent attributes. For example:
tdoc | An instance of a TidyDoc to query. |
ctmbstr TIDY_CALL tidyOptGetName | ( | TidyOption | opt | ) |
Get name of given Option.
opt | An instance of a TidyOption to query. |
ctmbstr TIDY_CALL tidyOptGetNextDeclTag | ( | TidyDoc | tdoc, |
TidyOptionId | optId, | ||
TidyIterator * | iter | ||
) |
Given a valid TidyIterator initiated with tidyOptGetDeclTagList(), returns a string representing a user-declared or autonomous custom tag.
tdoc | The tidy document to query. |
optId | The option ID matching the type of tag to retrieve. |
iter | The TidyIterator (initiated with tidyOptGetDeclTagList()) token. |
TidyOption TIDY_CALL tidyOptGetNextDocLinks | ( | TidyDoc | tdoc, |
TidyIterator * | pos | ||
) |
Given a valid TidyIterator initiated with tidyOptGetDocLinksList(), returns a TidyOption instance.
tdoc | The tidy document to query. |
pos | The TidyIterator (initiated with tidyOptGetDocLinksList()) token. |
Given a valid TidyIterator initiated with tidyOptGetMutedMessageList(), returns a string representing a muted message.
tdoc | The tidy document to query. |
iter | The TidyIterator (initiated with tidyOptGetMutedMessageList()) token. |
ctmbstr TIDY_CALL tidyOptGetNextPick | ( | TidyOption | opt, |
TidyIterator * | pos | ||
) |
Given a valid TidyIterator initiated with tidyOptGetPickList(), returns a string representing a possible option value.
opt | An instance of a TidyOption to query. |
pos | The TidyIterator (initiated with tidyOptGetPickList()) token. |
Given a valid TidyIterator initiated with tidyOptGetPriorityAttrList(), returns a string representing a priority attribute.
tdoc | The tidy document to query. |
iter | The TidyIterator (initiated with tidyOptGetPriorityAttrList()) token. |
TidyIterator TIDY_CALL tidyOptGetPickList | ( | TidyOption | opt | ) |
Initiates an iterator for a list of TidyOption pick-list values, which allows you iterate through all of the available option values.
In order to iterate through the available values, initiate the iterator with this function, and then use tidyOptGetNextPick() to retrieve the first and subsequent option values. For example:
opt | An instance of a TidyOption to query. |
Initiates an iterator for a list of priority attributes.
This iterator allows you to iterate through all of the priority attributes defined with the priority-attributes
configuration option. In order to iterate through the attributes, initiate the iterator with this function, and then use tidyOptGetNextPriorityAttr() to retrieve the first and subsequent attributes. For example:
tdoc | An instance of a TidyDoc to query. |
TidyOptionType TIDY_CALL tidyOptGetType | ( | TidyOption | opt | ) |
Get datatype of given Option.
opt | An instance of a TidyOption to query. |
ctmbstr TIDY_CALL tidyOptGetValue | ( | TidyDoc | tdoc, |
TidyOptionId | optId | ||
) |
Get the current value of the option ID for the given document.
tdoc | The tidy document whose option value you wish to check. |
optId | The option ID whose value you wish to check. |
Bool TIDY_CALL tidyOptionIsList | ( | TidyOption | opt | ) |
Indicates that an option takes a list of items.
opt | An instance of a TidyOption to query. |
Bool TIDY_CALL tidyOptIsReadOnly | ( | TidyOption | opt | ) |
Is Option read-only? Some options (mainly internal use only options) are read-only.
tidyOptGetCategory()
against TidyInternalCategory
. This API will be removed! opt | An instance of a TidyOption to query. |
yes
or no
depending on whether or not the specified option is read-only. Set named option value as a string, regardless of the TidyOptionType.
tdoc | The tidy document for which to set the value. |
optnam | The name of the option to set; this is the string value from the UI, e.g., error-file . |
val | The value to set, as a string. |
Reset all options to their default values.
tdoc | The tidy document for which to reset all values. |
Bool TIDY_CALL tidyOptResetToDefault | ( | TidyDoc | tdoc, |
TidyOptionId | opt | ||
) |
Reset option to default value by ID.
tdoc | The tidy document for which to reset the value. |
opt | The option ID to reset. |
Apply a snapshot of config settings to a document.
tdoc | The tidy document for which to apply a snapshot. |
Bool TIDY_CALL tidyOptSetBool | ( | TidyDoc | tdoc, |
TidyOptionId | optId, | ||
Bool | val | ||
) |
Set option value as a Boolean flag.
tdoc | The tidy document for which to set the value. |
optId | The option ID to set. |
val | The value to set. |
Bool TIDY_CALL tidyOptSetInt | ( | TidyDoc | tdoc, |
TidyOptionId | optId, | ||
ulong | val | ||
) |
Set option value as an integer.
tdoc | The tidy document for which to set the value. |
optId | The option ID to set. |
val | The value to set. |
Bool TIDY_CALL tidyOptSetValue | ( | TidyDoc | tdoc, |
TidyOptionId | optId, | ||
ctmbstr | val | ||
) |
Set the option value as a string.
tdoc | The tidy document for which to set the value. |
optId | The option ID of the value to set. |
val | The string value to set. |
Take a snapshot of current config settings.
These settings are stored within the tidy document. Note, however, that snapshots do not reliably survive the tidyParseXXX() process, as Tidy uses the snapshot mechanism in order to store the current configuration right at the beginning of the parsing process.
tdoc | The tidy document for which to take a snapshot. |
Bool TIDY_CALL tidySetConfigCallback | ( | TidyDoc | tdoc, |
TidyConfigCallback | pConfigCallback | ||
) |
Applications using TidyLib may want to augment command-line and configuration file options.
Setting this callback allows a LibTidy application developer to examine command-line and configuration file options after LibTidy has examined them and failed to recognize them.
yes
upon success. tdoc | The document to apply the callback to. |
pConfigCallback | The name of a function of type TidyConfigCallback() to serve as your callback. |
Bool TIDY_CALL tidySetConfigChangeCallback | ( | TidyDoc | tdoc, |
TidyConfigChangeCallback | pCallback | ||
) |
Applications using TidyLib may want to be informed when changes to options are made.
Temporary changes made internally by Tidy are not reported, but permanent changes made by Tidy (such as indent-spaces or output-encoding) will be reported.
yes
upon success. tdoc | The document to apply the callback to. |
pCallback | The name of a function of type TidyConfigChangeCallback() to serve as your callback. |
Bool TIDY_CALL tidySetOptionCallback | ( | TidyDoc | tdoc, |
TidyOptCallback | pOptCallback | ||
) |
Applications using TidyLib may want to augment command-line and configuration file options.
Setting this callback allows a LibTidy application developer to examine command-line and configuration file options after LibTidy has examined them and failed to recognize them. Note that this is deprecated and you should instead migrate to tidySetConfigCallback().
yes
upon success. tdoc | The document to apply the callback to. |
pOptCallback | The name of a function of type TidyOptCallback() to serve as your callback. |