| 124 | namespaceStack.pop_back(); |
| 125 | } |
| 126 | NamespaceInfo* IsNamespace(InplaceStr space) |
| 127 | { |
| 128 | for(int i = namespaceStack.size() - 1; i >= 0; i--) |
| 129 | { |
| 130 | unsigned hash = currNamespace ? currNamespace->hash : 0; |
| 131 | if(i == 0) |
| 132 | { |
| 133 | if(currNamespace) |
| 134 | { |
| 135 | hash = StringHashContinue(hash, "."); |
| 136 | hash = StringHashContinue(hash, space.begin, space.end); |
| 137 | }else{ |
| 138 | hash = GetStringHash(space.begin, space.end); |
| 139 | } |
| 140 | }else{ |
| 141 | hash = namespaceStack[i]->hash; |
| 142 | hash = StringHashContinue(hash, "."); |
| 143 | hash = StringHashContinue(hash, space.begin, space.end); |
| 144 | } |
| 145 | for(unsigned k = 0; k < CodeInfo::namespaceInfo.size(); k++) |
| 146 | { |
| 147 | if(CodeInfo::namespaceInfo[k]->hash == hash) |
| 148 | return CodeInfo::namespaceInfo[k]; |
| 149 | } |
| 150 | } |
| 151 | return NULL; |
| 152 | } |
| 153 | NamespaceInfo* GetCurrentNamespace() |
| 154 | { |
| 155 | return currNamespace; |
no test coverage detected