00001 #include "Name.h"
00002
00003 #include <cstring>
00004 #include <cstdio>
00005
00006
00007
00008 void
00009 setName(char* buf,const char* base,
00010 int bin,int weight,const char* pm)
00011 {
00012
00013 if(pm){
00014 sprintf(buf,"bin%d.weight%d.%s.%s",bin,weight,pm,base);
00015 }
00016 else{
00017 sprintf(buf,"bin%d.weight%d.%s",bin,weight,base);
00018 }
00019 }
00020
00021 void
00022 setNameWeight(char* buf, const char* base,int bin, const char* pm)
00023 {
00024 if(pm){
00025 sprintf(buf,"bin%d.weight.%s.%s",bin,pm,base);
00026 }
00027 else{
00028 sprintf(buf,"bin%d.weight.%s",bin,base);
00029 }
00030
00031 }
00032
00033 void
00034 setName(char* buf,const char* base,
00035 int bin,const char* pm)
00036 {
00037
00038 if(pm){
00039 sprintf(buf,"bin%d.%s.%s",bin,pm,base);
00040 }
00041 else{
00042 sprintf(buf,"bin%d.%s",bin,base);
00043 }
00044 }
00045
00046
00047 void
00048 setName(char* buf, const char* base,const char* ew,const char* pm)
00049 {
00050 sprintf(buf,"%s.%s.%s",ew,pm,base);
00051 }
00052
00053 void
00054 setName(char* buf, const char* base,const char* pm)
00055 {
00056 sprintf(buf,"%s.%s",pm,base);
00057 }