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 } |
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.