Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreMacros.h File Reference

Header file for a variety of plugin convenience macros. More...

This graph shows which files directly or indirectly include this file:

Macros

#define HDI_CORE_APP_VERSION_NUMBER   30
 
#define HDI_CORE_COMPILE_AI30_PLUS   1
 
#define HDI_CORE_COMPILE_AI29_PLUS   1
 
#define HDI_CORE_COMPILE_AI28_PLUS   1
 
#define HDI_CORE_COMPILE_AI28_MINUS   0
 
#define HDI_CORE_COMPILE_AI29_MINUS   0
 
#define HDI_CORE_COMPILE_AI30_MINUS   1
 
#define HDI_CORE_COMPILE_PS25_PLUS   0
 
#define HDI_CORE_COMPILE_PS24_PLUS   0
 
#define HDI_CORE_COMPILE_PS24_MINUS   0
 
#define HDI_CORE_COMPILE_PS25_MINUS   0
 
#define __HDI_CORE_BREAK_BLOCK_VAR(__HDI_N__)
 Helpers for the HDI_BREAK_BLOCK macro.
 
#define HDI_CORE_BREAK_BLOCK_VAR(__HDI_N__)
 
#define HDI_CORE_BREAK_BLOCK
 Helps to create a guaranteed one-iteration while loop for easy cleanup control (a common C++ practice, in one fashion or another)
 

Detailed Description

Header file for a variety of plugin convenience macros.

Macro Definition Documentation

◆ __HDI_CORE_BREAK_BLOCK_VAR

#define __HDI_CORE_BREAK_BLOCK_VAR ( __HDI_N__)
Value:
__hdi_core_breakblock_ ## __HDI_N__

Helpers for the HDI_BREAK_BLOCK macro.

◆ HDI_CORE_BREAK_BLOCK

#define HDI_CORE_BREAK_BLOCK
Value:
short HDI_CORE_BREAK_BLOCK_VAR(__LINE__) = 0; \
while( (++HDI_CORE_BREAK_BLOCK_VAR(__LINE__)) == 1 )

Helps to create a guaranteed one-iteration while loop for easy cleanup control (a common C++ practice, in one fashion or another)

Let's say you have a function with lots of initial conditions to check before proceeding with the desired task, but every time a condition fails lots of lines of cleanup code need to be executed. One way to approach this is with many nested if-blocks (ugly and hard to read), or with pasting the cleanup code in each sequential condition's block (hard to maintain and error prone). A much better alternative to either approach is to use a loop or switch to create a block within which the "break" keyword can be used, and put the cleanup code outside of the block (such that breaking out of the block or successfully executing the entirety of the block will always result in the same cleanup code being executed afterwards, and without any of the drawbacks of the aforementioned approaches).

◆ HDI_CORE_BREAK_BLOCK_VAR

#define HDI_CORE_BREAK_BLOCK_VAR ( __HDI_N__)
Value:
#define __HDI_CORE_BREAK_BLOCK_VAR(__HDI_N__)
Helpers for the HDI_BREAK_BLOCK macro.
Definition hdicoreMacros.h:100