IAR常用Edit模板举例

################################################################################
##
## This is an example file for defining your own code templates.
##
## The syntax for defining code templates is:
## #TEMPLATE <template name>,<field>[=default value], <field>...
##
## The template name, the fields and their default values should be defined 
## within quotes if they contain, for example space characters, equal signs, 
## or comma characters.
## Use "&" in front of a letter to make the letter become a shortcut,
## which means that you can use ALT+<letter> to select the template or jump
## to the field in the dialog box.
##
################################################################################
#TEMPLATE "if"
if( %c ){
}

#TEMPLATE for,"&End Value"=10,&Variable=i
for(int %2 = 0; %2 < %1; ++%2){
  %c
  }

#TEMPLATE switch
 switch( %c ){
 case 0:
     break;
 default:
     break;
     }
 
#TEMPLATE class,"Class &name",&Description=--
//******************
//
// CLASS: %1
//
// DESCRIPTION:
//  %2
//
class %1
{
  %1();
  ~%1();
  %c
};

#TEMPLATE "&File_Declare>Head_File_Declare","&File Name",&Description,&Version,&Created="Gzz",&date="$DATE$",&Built="$TOOLKIT_DIR$"
/***********************************************************
 *
 * Copyright (C), 2013, Zjut Image Processing Lab . 
 *
 * FileName:%1
 * Author: Gzz       Version : %3         Date: %5
 * Description: %2      
 * Function List:   
   1. main
 * Others:
 * Modification History:          
   <author>  <time>   <version >   <desc>       
***********************************************************/

#TEMPLATE "&File_Declare>&Source_File_Declare","&File Name",&Description,&Version,&Created="Gzz",&date="$DATE$",&Built="$TOOLKIT_DIR$"
/***********************************************************
 *
 * Copyright (C), 2013, Zjut Image Processing Lab . 
 *
 * FileName:%1
 * Author: Gzz       Version : %3         Date: %5
 * Description: %2      
 * Function List:   
   1. main
 * Others:
 * Modification History:          
   <author>  <time>   <version >   <desc>       
***********************************************************/

#TEMPLATE "Usual_Macro>&ifndef","File &Name"
#ifndef _H_%1_H
#define _H_%1_H
#ifdef __cplusplus
extern "C"{
#endif

%c

#ifdef __cplusplus
extern "C"}
#endif
#endif // _H_%1_H



 

#TEMPLATE &Function>&Main,&name=Main,&Created="$DATE$"

/************************************************************
 * Function: %1
 * Description: The main function,the start entry of program !
 * Calls:
 * Author: Gzz      Build_Date:%2  
 * Others:
************************************************************/

void main(void)
{
    %c
    while(1){
    };
}
 
#TEMPLATE &Function>&Function,"Function &name","Input ¶meter","Return ¶meter_type",&Description=--,&Created_time="$DATE$"

/************************************************************
 * Function: %1
 * Description: 
 * Input parameter: %2
 * Return parameter: %3
 * Calls:
 * Called by:
 * Author: Gzz      Build_Date:%5  
 * Other:
*************************************************************/
 
%3 %1(%2)
{
    %c
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值