source: dev/trunk/abdev/BasicCompiler_Common/src/Namespace.cpp@ 215

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

BoostSerializationSupportのクラステンプレートインスタンスを明示的に生成するようにした(コンパイル時間の短縮)

File size: 1.2 KB
Line 
1#include "stdafx.h"
2
3#include <jenga/include/smoothie/BasicFixed.h>
4#include <jenga/include/smoothie/Smoothie.h>
5#include <jenga/include/smoothie/Namespace.h>
6#include <jenga/include/smoothie/SmoothieException.h>
7
8
9NamespaceScopes::NamespaceScopes( const string &namespaceStr ){
10 if( namespaceStr.size() == 0 ){
11 return;
12 }
13
14 string::size_type i = 0;
15 while( true ){
16 string::size_type i2 = namespaceStr.find( '.', i );
17
18 string tempName = namespaceStr.substr( i, i2-i );
19
20 push_back( tempName );
21
22 if( i2 == string::npos ){
23 break;
24 }
25
26 i = i2 + 1;
27 }
28}
29
30void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const
31{
32 NamespaceScopes namespaceScopes( fullName );
33 bool hasSimpleName = false;
34 while( namespaceScopes.size() > 0 ){
35 if( IsExist( namespaceScopes ) ){
36 break;
37 }
38 namespaceScopes.pop_back();
39
40 hasSimpleName = true;
41 }
42
43 lstrcpy( namespaceStr, namespaceScopes.ToString().c_str() );
44
45 bool hasNamespace = false;
46 if( namespaceStr[0] ){
47 hasNamespace = true;
48 }
49
50 int dotLength = 0;
51 if( hasSimpleName && hasNamespace ){
52 dotLength = 1;
53 }
54
55 lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength );
56}
57
Note: See TracBrowser for help on using the repository browser.