Changeset 507 in dev for trunk/ab5.0/abdev/ab_common
- Timestamp:
- Apr 28, 2008, 8:14:31 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/ab_common
- Files:
-
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/ab_common.vcproj
r505 r507 320 320 > 321 321 </File> 322 <File 323 RelativePath=".\include\NamespaceSupporter.h" 324 > 325 </File> 322 326 </Filter> 323 327 </Filter> … … 340 344 <File 341 345 RelativePath=".\src\Namespace.cpp" 346 > 347 </File> 348 <File 349 RelativePath=".\src\NamespaceSupporter.cpp" 342 350 > 343 351 </File> -
trunk/ab5.0/abdev/ab_common/include/Namespace.h
r505 r507 1 1 #pragma once 2 3 #include <vector>4 #include <string>5 #include <boost/foreach.hpp>6 2 7 3 -
trunk/ab5.0/abdev/ab_common/include/NamespaceSupporter.h
r506 r507 1 1 #pragma once 2 3 namespace ActiveBasic{ namespace Common{ namespace Lexical{ 4 2 5 3 6 class NamespaceSupporter 4 7 { 8 const NamespaceScopesCollection *allNamespaceScopesCollection; 9 5 10 // Importsされた名前空間 6 11 NamespaceScopesCollection importedNamespaces; … … 10 15 11 16 public: 17 NamespaceSupporter() 18 : allNamespaceScopesCollection( NULL ) 19 { 20 } 21 22 void RegistAllNamespaceScopesCollection( const NamespaceScopesCollection *allNamespaceScopesCollection ) 23 { 24 this->allNamespaceScopesCollection = allNamespaceScopesCollection; 25 } 26 12 27 NamespaceScopesCollection &GetImportedNamespaces() 13 28 { … … 18 33 this->importedNamespaces = namespaces; 19 34 } 35 bool ImportsNamespace( const NamespaceScopes &namespaceScopes ); 20 36 bool ImportsNamespace( const std::string &namespaceStr ); 21 37 … … 40 56 // entryName = "ActiveBasic" 41 57 // この場合、living は entryName を包括している。 42 bool IsCoverd( const NamespaceScopes &namespaceScopes, const st ring &entryName ) const58 bool IsCoverd( const NamespaceScopes &namespaceScopes, const std::string &entryName ) const 43 59 { 44 if( namespaceScopes.IsEqual( entryName ) ){ 60 if( namespaceScopes.IsEqual( entryName ) ) 61 { 45 62 return true; 46 63 } 47 64 48 st ring thisStr = namespaceScopes.ToString();65 std::string thisStr = namespaceScopes.ToString(); 49 66 50 67 NamespaceScopes tempLivingNamespaceScopes = livingNamespaceScopes; 51 68 52 while( tempLivingNamespaceScopes.size() ){ 53 string tempStr = tempLivingNamespaceScopes.ToString() + "." + entryName; 54 if( thisStr == tempStr ){ 69 while( tempLivingNamespaceScopes.size() ) 70 { 71 std::string tempStr = tempLivingNamespaceScopes.ToString() + "." + entryName; 72 if( thisStr == tempStr ) 73 { 55 74 return true; 56 75 } … … 98 117 } 99 118 }; 119 120 121 }}} -
trunk/ab5.0/abdev/ab_common/src/NamespaceSupporter.cpp
r506 r507 1 1 #include "stdafx.h" 2 2 3 #include <Compiler.h> 3 using namespace ActiveBasic::Common::Lexical; 4 4 5 bool NamespaceSupporter::ImportsNamespace( const std::string &namespaceStr)5 bool NamespaceSupporter::ImportsNamespace( const NamespaceScopes &namespaceScopes ) 6 6 { 7 NamespaceScopes namespaceScopes( namespaceStr ); 8 if( !compiler.GetObjectModule().meta.GetNamespaces().IsExist( namespaceScopes ) ){ 7 if( !allNamespaceScopesCollection->IsExist( namespaceScopes ) ){ 9 8 return false; 10 9 } … … 14 13 return true; 15 14 } 15 16 bool NamespaceSupporter::ImportsNamespace( const std::string &namespaceStr ) 17 { 18 NamespaceScopes namespaceScopes( namespaceStr ); 19 20 return ImportsNamespace( namespaceScopes ); 21 } -
trunk/ab5.0/abdev/ab_common/stdafx.h
r505 r507 34 34 35 35 #include <Namespace.h> 36 #include <NamespaceSupporter.h>
Note:
See TracChangeset
for help on using the changeset viewer.