HDK
|
Defines a script that computes an override value. More...
#include <STY_OverrideScript.h>
Public Types | |
enum | CodeSourceType { CODE_INVALID, CODE_SHARED, CODE_FILE, CODE_NODE, CODE_BINDING, CODE_INLINE } |
Public Member Functions | |
STY_OverrideScript (const UT_JSONValue *json, const STY_LoadContext *load_context) | |
STY_OverrideScript (const CodeSourceType code_source, const UT_StringHolder &code, const UT_StringHolder &return_variable, const UT_Array< STY_BindingHandle > *bindings) | |
~STY_OverrideScript () | |
bool | createOverrideValues (UT_Array< STY_ConstantHandle > *opt_values, UT_JSONValue *json_values, const STY_TargetMatchClosureHandle *closures, int num_closures) const |
void | appendBindingDataNames (UT_StringArray &names) const |
void | saveStyleSheet (UT_JSONValueMap *map, bool allow_shared_scripts) const |
Save this override set as JSON to a style sheet. More... | |
CodeSourceType | getCodeSource (bool from_import) const |
Access the attributes that define the script. More... | |
const UT_StringHolder & | getCode (bool from_import) const |
const UT_StringHolder & | getReturnVariable (bool from_import) const |
const UT_Array < STY_BindingHandle > * | getBindings (bool from_import) const |
Public Member Functions inherited from UT_IntrusiveRefCounter< STY_OverrideScript > | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
Default constructor: Sets counter to 0. More... | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
Copy constructor: Sets counter to 0. More... | |
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
Assignment operator: Does not modify counter. More... | |
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
Return current counter. More... | |
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
Static Public Member Functions | |
static const UT_StringHolder & | codeSourceToStr (CodeSourceType code_source) |
Convert CodeSourceType to/from a string equivalent. More... | |
static CodeSourceType | codeSourceFromStr (const UT_StringHolder &str) |
Additional Inherited Members | |
Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable | |
UT_NonCopyable ()=default | |
~UT_NonCopyable ()=default | |
UT_NonCopyable (const UT_NonCopyable &)=delete | |
UT_NonCopyable & | operator= (const UT_NonCopyable &)=delete |
Protected Member Functions inherited from UT_IntrusiveRefCounter< STY_OverrideScript > | |
SYS_FORCE_INLINE | ~UT_IntrusiveRefCounter () |
Destructor: Only derived classes can destruct this. More... | |
Defines a script that computes an override value.
Definition at line 46 of file STY_OverrideScript.h.
Enumerator | |
---|---|
CODE_INVALID | |
CODE_SHARED | |
CODE_FILE | |
CODE_NODE | |
CODE_BINDING | |
CODE_INLINE |
Definition at line 51 of file STY_OverrideScript.h.
STY_OverrideScript::STY_OverrideScript | ( | const UT_JSONValue * | json, |
const STY_LoadContext * | load_context | ||
) |
Creates an override script object and loads it from the given json. If load context is not NULL, the script can resolve any references the script may have (if it has no references, the context is not needed).
STY_OverrideScript::STY_OverrideScript | ( | const CodeSourceType | code_source, |
const UT_StringHolder & | code, | ||
const UT_StringHolder & | return_variable, | ||
const UT_Array< STY_BindingHandle > * | bindings | ||
) |
STY_OverrideScript::~STY_OverrideScript | ( | ) |
void STY_OverrideScript::appendBindingDataNames | ( | UT_StringArray & | names | ) | const |
Appends data names that this script is interested in for its input argument binding.
|
static |
|
static |
Convert CodeSourceType to/from a string equivalent.
bool STY_OverrideScript::createOverrideValues | ( | UT_Array< STY_ConstantHandle > * | opt_values, |
UT_JSONValue * | json_values, | ||
const STY_TargetMatchClosureHandle * | closures, | ||
int | num_closures | ||
) | const |
Obtains override values for multiple closures in one call. The data can come back as either STY_Constant or UT_JSONValues.
const UT_Array<STY_BindingHandle>* STY_OverrideScript::getBindings | ( | bool | from_import | ) | const |
const UT_StringHolder& STY_OverrideScript::getCode | ( | bool | from_import | ) | const |
CodeSourceType STY_OverrideScript::getCodeSource | ( | bool | from_import | ) | const |
Access the attributes that define the script.
const UT_StringHolder& STY_OverrideScript::getReturnVariable | ( | bool | from_import | ) | const |
void STY_OverrideScript::saveStyleSheet | ( | UT_JSONValueMap * | map, |
bool | allow_shared_scripts | ||
) | const |
Save this override set as JSON to a style sheet.