Changeset 1224 in Sophya for trunk/SophyaPI/PIext/nomgadapter.cc
- Timestamp:
- Oct 11, 2000, 7:26:43 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nomgadapter.cc
r1222 r1224 143 143 } 144 144 145 /* --Methode-- */146 string NObjMgrAdapter::DecodeTypeIdName(string linuxtype)147 // seulement pour Linux qui ne code pas correctement148 {149 #if defined(Linux) || defined(linux)150 string type("");151 const char* str = linuxtype.c_str();152 int lstr = (int) strlen(str);153 if(lstr<=0) return string("Linux Decoding error: lstr<=0");154 155 // Le dernier caractere donne le type156 lstr--;157 if (str[lstr]=='v') type = "void";158 else if(str[lstr]=='b') type = "bool";159 else if(str[lstr]=='c') type = "char";160 else if(str[lstr]=='s') type = "short";161 else if(str[lstr]=='i') type = "int";162 else if(str[lstr]=='l') type = "long";163 else if(str[lstr]=='x') type = "long long";164 else if(str[lstr]=='f') type = "float";165 else if(str[lstr]=='d') type = "double";166 else if(str[lstr]=='r') type = "long double";167 else return string("Linux Decoding error: bad last char");168 if(lstr==0) return type;169 170 // Les caracteres precedents donnent: signed, unsigned, *, & ou const.171 // Mais si on a un Z, alors c'est un complexe (code ...t7complex1Z...)172 for(int i=0; i<(int)strlen(str); i++) {173 lstr--;174 if (str[lstr]=='U') type = "unsigned " + type;175 else if(str[lstr]=='S') type = "signed " + type;176 else if(str[lstr]=='P') type = type + "*";177 else if(str[lstr]=='R') type = type + "&";178 else if(str[lstr]=='C') type = "const " + type;179 else if(str[lstr]=='Z') { // Complexe180 type = "complex<" + type + ">";181 for(int j=0;j<(int)strlen(str);j++) {182 if (str[j]=='P') type = type + "*";183 else if(str[j]=='R') type = type + "&";184 else if(str[j]=='C') type = "const " + type;185 else if(str[j]=='t') break;186 else return string("Linux Decoding error: bad char 1,2 for Z");187 }188 break;189 }190 else return string("Linux Decoding error: bad last-1,last-2 char");191 if(lstr==0) break;192 }193 194 return type;195 #else196 return linuxtype;197 #endif198 }
Note:
See TracChangeset
for help on using the changeset viewer.