Changeset 194 in dev for trunk/jenga/src/smoothie/Namespace.cpp
- Timestamp:
- Jun 26, 2007, 1:48:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jenga/src/smoothie/Namespace.cpp
r192 r194 25 25 } 26 26 } 27 28 bool NamespaceScopes::IsLiving() const29 {30 if( IsBelong( *this, Smoothie::Temp::liveingNamespaceScopes ) ){31 return true;32 }33 return false;34 }35 36 // 包括しているかをチェック37 // 例:38 // this = "Discoversoft.ActiveBasic"39 // living = "Discoversoft.ActiveBasic"40 // name = "ActiveBasic"41 // この場合、living は name を包括している。42 bool NamespaceScopes::IsCoverd( const string &name ) const43 {44 if( IsEqual( name ) ){45 return true;46 }47 48 string thisStr = ToString();49 50 NamespaceScopes tempLivingNamespaceScopes = Smoothie::Temp::liveingNamespaceScopes;51 52 while( tempLivingNamespaceScopes.size() ){53 NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes;54 55 string tempStr = tempNamespaceScopes.ToString() + "." + name;56 if( thisStr == tempStr ){57 return true;58 }59 60 tempLivingNamespaceScopes.pop_back();61 }62 return false;63 }64 bool NamespaceScopes::IsCoverd( const NamespaceScopes &namespaceScopes ) const65 {66 return IsCoverd( namespaceScopes.ToString() );67 }68 69 27 70 28 void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const … … 95 53 lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength ); 96 54 } 97 bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )98 {99 int i, i2;100 char temporary[1024];101 55 102 bool isSuccessful = true;103 104 // 名前空間管理105 NamespaceScopes namespaceScopes;106 107 for(i=0;;i++){108 if(source[i]=='\0') break;109 110 if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){111 for(i+=2,i2=0;;i2++,i++){112 if( IsCommandDelimitation( source[i] ) ){113 temporary[i2]=0;114 break;115 }116 temporary[i2]=source[i];117 }118 namespaceScopes.push_back( temporary );119 120 if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){121 namespaceScopesCollection.push_back( namespaceScopes );122 }123 124 continue;125 }126 else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){127 if( namespaceScopes.size() <= 0 ){128 SmoothieException::Throw( 12, "End Namespace", i );129 isSuccessful = false;130 }131 else{132 namespaceScopes.pop_back();133 }134 135 i += 2;136 continue;137 }138 }139 140 if( namespaceScopes.size() > 0 ){141 SmoothieException::Throw( 63 );142 isSuccessful = false;143 }144 145 return isSuccessful;146 }
Note:
See TracChangeset
for help on using the changeset viewer.