if(!value.contains("xxx")){LOGIT(WARNING,"value is incomplete.\n")return;}char suffix[16]="xxx";int data_len=100;if(!value.empty()&&value.contains("tom")){constchar* name=value.c_str();for(int i=1;i<MAX_LEN;i++){...// do something}int count=0;for(int i=0;i<strlen(name);i++){..//do something}}
代码留白(错落有致、舒缓得当):
if(!value.contains("xxx")){LOGIT(WARNING,"value is incomplete.\n")return;}char suffix[16]="xxx";int data_len =100;if(!value.empty()&& value.contains("tom")){constchar* name = value.c_str();for(int i =1; i < MAX_LEN; i++){...// do something}int count =0;for(int i =0; i <strlen(name); i++){..//do something}}
// author : louis// date : 2023.4.4// purpose : get inner counter value of generic T// notice : T must have xxx member// notice : return value maybe -1,means ..., you should ...template<typenameT>intget_value(const T& v);
#ifndef_XXX_HPP_INCLUDE_#define_XXX_HPP_INCLUDE_// This is the full imeplement of XXX,we do not need any cpp fileclassXXXfinal{public:voidfunction1(){...}voidfunction2(){...}};#endif// _XXX_HPP_INCLUDE_