Changeset 173 in dev for trunk/jenga/include/smoothie/Source.h
- Timestamp:
- Jun 20, 2007, 3:38:44 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jenga/include/smoothie/Source.h
r170 r173 34 34 bool ReadFile( const string &filePath ); 35 35 36 static bool IsBlank( char c )37 {38 if( c == ' ' || c == '\t' )39 {40 return true;41 }42 return false;43 }44 36 static void Text::SlideString(char *buffer, int slide){ 45 37 char *temp; … … 82 74 return buffer+2; 83 75 } 84 int GetLength(){ 76 const char *GetBuffer() const 77 { 78 return buffer+2; 79 } 80 int GetLength() const 81 { 85 82 return length-2; 86 83 } … … 99 96 } 100 97 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"; 104 103 } 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]; 144 105 } 145 106 };
Note:
See TracChangeset
for help on using the changeset viewer.