source: dev/BasicCompiler_Common/include/Namespace.h@ 100

Last change on this file since 100 was 100, checked in by dai_9181, 17 years ago

名前空間機能をグローバル関数に適用。

File size: 721 bytes
Line 
1#pragma once
2
3#include <vector>
4#include <string>
5#include <boost/foreach.hpp>
6
7using namespace std;
8
9class NamespaceScopes : public vector<string>
10{
11public:
12 NamespaceScopes(){}
13 ~NamespaceScopes(){}
14
15 void ToString( string &namespaceStr ) const
16 {
17 const vector<string> &me = *this;
18
19 bool isFirst = true;
20 BOOST_FOREACH( const string &itemStr, me ){
21 if( isFirst ){
22 isFirst = false;
23 }
24 else{
25 namespaceStr += ".";
26 }
27
28 namespaceStr += itemStr;
29 }
30 }
31
32 bool Equal( const string &name ) const
33 {
34 string tempName;
35 ToString( tempName );
36 if( tempName == name ){
37 return true;
38 }
39 return false;
40 }
41
42 bool IsUsing() const
43 {
44 return false;
45 }
46};
Note: See TracBrowser for help on using the repository browser.