[206] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | #include <vector>
|
---|
| 4 | #include <string>
|
---|
| 5 |
|
---|
[215] | 6 | #include <BoostSerializationSupport.h>
|
---|
| 7 | #include <Namespace.h>
|
---|
| 8 |
|
---|
[206] | 9 | using namespace std;
|
---|
| 10 |
|
---|
| 11 | class Symbol
|
---|
| 12 | {
|
---|
| 13 | NamespaceScopes namespaceScopes;
|
---|
| 14 | string name;
|
---|
| 15 |
|
---|
| 16 | // XMLシリアライズ用
|
---|
| 17 | private:
|
---|
| 18 | friend class boost::serialization::access;
|
---|
[208] | 19 | BOOST_SERIALIZATION_SPLIT_MEMBER();
|
---|
| 20 | template<class Archive> void load(Archive& ar, const unsigned int version)
|
---|
[206] | 21 | {
|
---|
[210] | 22 | //trace_for_serialize( "serializing(load) - Symbol" );
|
---|
[208] | 23 |
|
---|
[206] | 24 | ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
|
---|
[208] | 25 |
|
---|
| 26 | std::string _name;
|
---|
| 27 | ar & BOOST_SERIALIZATION_NVP( _name );
|
---|
| 28 | this->name = Operator_NaturalStringToCalcMarkString( _name );
|
---|
[206] | 29 | }
|
---|
[208] | 30 | template<class Archive> void save(Archive& ar, const unsigned int version) const
|
---|
| 31 | {
|
---|
[210] | 32 | //trace_for_serialize( "serializing(save) - Symbol" );
|
---|
[206] | 33 |
|
---|
[208] | 34 | ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
|
---|
| 35 |
|
---|
| 36 | std::string _name = Operator_CalcMarkStringToNaturalString( name );
|
---|
| 37 | ar & BOOST_SERIALIZATION_NVP( _name );
|
---|
| 38 | }
|
---|
| 39 |
|
---|
[206] | 40 | public:
|
---|
[271] | 41 | bool isTargetObjectModule;
|
---|
[206] | 42 | Symbol( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
| 43 | : namespaceScopes( namespaceScopes )
|
---|
| 44 | , name( name )
|
---|
[271] | 45 | , isTargetObjectModule( true )
|
---|
[206] | 46 | {
|
---|
| 47 | }
|
---|
| 48 | Symbol( const char *fullName );
|
---|
| 49 | Symbol( const string &fullName );
|
---|
| 50 | Symbol( const Symbol &symbol )
|
---|
| 51 | : namespaceScopes( symbol.namespaceScopes )
|
---|
| 52 | , name( symbol.name )
|
---|
[271] | 53 | , isTargetObjectModule( true )
|
---|
[206] | 54 | {
|
---|
| 55 | }
|
---|
| 56 | Symbol()
|
---|
[271] | 57 | : isTargetObjectModule( true )
|
---|
[206] | 58 | {
|
---|
| 59 | }
|
---|
| 60 |
|
---|
[208] | 61 | virtual const NamespaceScopes &GetNamespaceScopes() const
|
---|
[206] | 62 | {
|
---|
| 63 | return namespaceScopes;
|
---|
| 64 | }
|
---|
| 65 | const string &GetName() const
|
---|
| 66 | {
|
---|
| 67 | return name;
|
---|
| 68 | }
|
---|
[348] | 69 | std::string GetFullName() const;
|
---|
[206] | 70 |
|
---|
| 71 | // シンボル比較
|
---|
| 72 | bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
|
---|
| 73 | bool IsEqualSymbol( const Symbol &symbol ) const;
|
---|
[208] | 74 | bool IsEqualSymbol( const char *fullName ) const;
|
---|
| 75 | bool IsEqualSymbol( const string &fullName ) const
|
---|
| 76 | {
|
---|
| 77 | return IsEqualSymbol( fullName.c_str() );
|
---|
| 78 | }
|
---|
[206] | 79 | };
|
---|