Jindent - Java Source Code Formatter http://www.jindent.com
 



title
5.6.2.2.5 Directives/Macros

Indent preprocessor directives

Indent preprocessor directives

Controls whether preprocessor directives are aligned to the first column or indented to the current block scope.


Align preprocessor directies to first column:

class·Test·{                            
····void·test()                         
····{                                   
#ifdef
·_A                               
········cout·<<·"A";                    
#else                                   
········if·(condition)                  
········{                               
············if·(anotherCondition)       
············{                           
#ifdef
·_B                               
················cout·<<·"B";            
                                        
#ifdef
·_C                               
················cout·<<·"C";            
#endif                                  
                                        
#endif                                  
············}                           
········}                               
#endif                                  
····}                                   
}                                       


Indent peprocessor directives relative to source code:

class·Test·{                            
····void·test()                         
····{                                   
····#ifdef·_A                           
········cout·<<·"A";                    
····#else                               
········if·(condition)                  
········{                               
············if·(anotherCondition)       
············{                           
············#ifdef·_B                   
················cout·<<·"B";            
                                        
············#ifdef·_C                   
················cout·<<·"C";            
············#endif                      
                                        
············#endif                      
············}                           
········}                               
····#endif                              
····}                                   
}                                       



Indent block within Begin- and End-macros

Indent block within Begin- and End-macros

Indents source code declared within preprocessor function calls which names starts with BEGIN and END.


Indentation of 4:

IMPLEMENT_DYNAMIC(CAddSourceDlg,·CDialog)
BEGIN_MESSAGE_MAP(CAddSourceDlg,
·CResizableDialog)
····ON_BN_CLICKED(IDC_RSRC,·OnBnClickedRadio1)
····ON_BN_CLICKED(IDC_RURL,·OnBnClickedRadio4)
····ON_BN_CLICKED(IDC_BUTTON1,·OnBnClickedButton1)
····ON_BN_CLICKED(IDOK,·OnBnClickedOk)  
END_MESSAGE_MAP()                       


Indentation of 0:

IMPLEMENT_DYNAMIC(CAddSourceDlg,·CDialog)
BEGIN_MESSAGE_MAP(CAddSourceDlg,
·CResizableDialog)
ON_BN_CLICKED(IDC_RSRC,
·OnBnClickedRadio1)
ON_BN_CLICKED(IDC_RURL,
·OnBnClickedRadio4)
ON_BN_CLICKED(IDC_BUTTON1,
·OnBnClickedButton1)
ON_BN_CLICKED(IDOK,
·OnBnClickedOk)      
END_MESSAGE_MAP()