Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

/ray/src/vm/vartype.cc

Go to the documentation of this file.
00001 /*
00002  * vm/vartype.cc
00003  * 
00004  * VM basic variable type. 
00005  * 
00006  * Copyright (c) 2004 by Wolfgang Wieser ] wwieser (a) gmx <*> de [ 
00007  * 
00008  * This file may be distributed and/or modified under the terms of the 
00009  * GNU General Public License version 2 as published by the Free Software 
00010  * Foundation. (See COPYING.GPL for details.)
00011  * 
00012  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00013  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00014  * 
00015  */
00016 
00017 #include "vartype.h"
00018 
00019 
00020 namespace VM
00021 {
00022 
00023 TLString VarType::TypeString() const
00024 {
00025     TLString str;
00026     
00027     char tmp[2];
00028     int idx=0;
00029     
00030     if(array) tmp[idx++]='a';
00031     switch(id)
00032     {
00033         case Unknown:  tmp[idx++]='*';  break;
00034         case Byte:     tmp[idx++]='b';  break;
00035         case Short:    tmp[idx++]='s';  break;
00036         case Int:      tmp[idx++]='i';  break;
00037         case Long:     tmp[idx++]='l';  break;
00038         case Flt:      tmp[idx++]='f';  break;
00039         case Dbl:      tmp[idx++]='d';  break;
00040         case Ptr:      tmp[idx++]='p';  break;
00041         default:       tmp[idx++]='?';  break;
00042     }
00043     str.assign(tmp,idx);
00044     
00045     return(str);
00046 }
00047 
00048 }  // end of namespace VM

Generated on Sat Feb 19 22:33:47 2005 for Ray by doxygen 1.3.5