Changeset 640 for cpp/frams/param
- Timestamp:
- 12/05/16 02:31:34 (8 years ago)
- Location:
- cpp/frams/param
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/param.cpp
r574 r640 739 739 } 740 740 741 SString ParamInterface::describeType(const char* type) 742 { 743 SString t; 744 switch(type[0]) 745 { 746 case 'd': t+="integer"; 747 {paInt a,b,c; int n=getMinMax(type,a,b,c); if (n>=2) t+=SString::sprintf(" %d..%d",a,b); if (n>=3) t+=SString::sprintf(" (default %d)",c);} 748 break; 749 case 'f': t+="float"; 750 {double a,b,c; int n=getMinMax(type,a,b,c); if (n>=2) t+=SString::sprintf(" %g..%g",a,b); if (n>=3) t+=SString::sprintf(" (default %g)",c);} 751 break; 752 case 's': t+="string"; 753 {int a,b; SString c; int n=getMinMax(type,a,b,c); if ((n>=2)&&(b>0)) t+=SString::sprintf(", max %d chars",b); if (n>=3) t+=SString::sprintf(" (default \"%s\")",c.c_str());} 754 break; 755 case 'x': t+="untyped value"; break; 756 case 'p': t+="function"; break; 757 case 'o': t+="object"; if (type[1]) {t+=" of class "; t+=type+1;} break; 758 default: return "unknown type"; 759 } 760 return t; 761 } 762 741 763 //////////////////////////////// PARAM //////////////////////////////////// 742 764 -
cpp/frams/param/param.h
r574 r640 155 155 void setMax(int i); 156 156 157 /** return the human readable description of the given type */ 158 static SString describeType(const char* type); 159 SString describeType(int i) {return describeType(type(i));} 160 157 161 /** copy all property values from other ParamInterface object */ 158 162 void copyFrom(ParamInterface *src);
Note: See TracChangeset
for help on using the changeset viewer.