HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_OverrideScript Class Reference

Defines a script that computes an override value. More...

#include <STY_OverrideScript.h>

+ Inheritance diagram for STY_OverrideScript:

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_StringHoldergetCode (bool from_import) const
 
const UT_StringHoldergetReturnVariable (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_IntrusiveRefCounteroperator= (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_StringHoldercodeSourceToStr (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_NonCopyableoperator= (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...
 

Detailed Description

Defines a script that computes an override value.

Definition at line 46 of file STY_OverrideScript.h.

Member Enumeration Documentation

Enumerator
CODE_INVALID 
CODE_SHARED 
CODE_FILE 
CODE_NODE 
CODE_BINDING 
CODE_INLINE 

Definition at line 51 of file STY_OverrideScript.h.

Constructor & Destructor Documentation

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 ( )

Member Function Documentation

void STY_OverrideScript::appendBindingDataNames ( UT_StringArray names) const

Appends data names that this script is interested in for its input argument binding.

static CodeSourceType STY_OverrideScript::codeSourceFromStr ( const UT_StringHolder str)
static
static const UT_StringHolder& STY_OverrideScript::codeSourceToStr ( CodeSourceType  code_source)
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.


The documentation for this class was generated from the following file: