Ignore:
Timestamp:
Jun 20, 2007, 3:38:44 AM (17 years ago)
Author:
dai_9181
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jenga/include/smoothie/Source.h

    r170 r173  
    3434    bool ReadFile( const string &filePath );
    3535
    36     static bool IsBlank( char c )
    37     {
    38         if( c == ' ' || c == '\t' )
    39         {
    40             return true;
    41         }
    42         return false;
    43     }
    4436    static void Text::SlideString(char *buffer, int slide){
    4537        char *temp;
     
    8274        return buffer+2;
    8375    }
    84     int GetLength(){
     76    const char *GetBuffer() const
     77    {
     78        return buffer+2;
     79    }
     80    int GetLength() const
     81    {
    8582        return length-2;
    8683    }
     
    9996    }
    10097
    101     static bool IsCommandDelimitation( char c ){
    102         if( c == '\n' || c == ':' || c == '\0' ){
    103             return true;
     98    char operator[]( int index ) const
     99    {
     100        if( index>GetLength() )
     101        {
     102            throw "bad access";
    104103        }
    105 
    106         return false;
    107     }
    108 
    109     static int JumpStringInPare(const char *buffer,int pos){
    110         int PareNum;
    111         for(PareNum=1;;pos++){
    112             if(buffer[pos]=='\"'){
    113                 for(pos++;;pos++){
    114                     if(buffer[pos]=='\"') break;
    115                 }
    116                 continue;
    117             }
    118             else if(buffer[pos]=='(') PareNum++;
    119             else if(buffer[pos]==')'){
    120                 PareNum--;
    121                 if(PareNum==0) return pos;
    122             }
    123             else if(buffer[pos]=='\0') break;
    124         }
    125         return 0;
    126     }
    127     static int JumpStringInBracket(const char *buffer,int pos){
    128         int PareNum;
    129         for(PareNum=1;;pos++){
    130             if(buffer[pos]=='\"'){
    131                 for(pos++;;pos++){
    132                     if(buffer[pos]=='\"') break;
    133                 }
    134                 continue;
    135             }
    136             else if(buffer[pos]=='[') PareNum++;
    137             else if(buffer[pos]==']'){
    138                 PareNum--;
    139                 if(PareNum==0) return pos;
    140             }
    141             else if(buffer[pos]=='\0') break;
    142         }
    143         return 0;
     104        return buffer[2+index];
    144105    }
    145106};
Note: See TracChangeset for help on using the changeset viewer.