| Line |   | 
|---|
| 1 | #include "stdafx.h"
 | 
|---|
| 2 | 
 | 
|---|
| 3 | std::string ActiveBasic::Common::Environment::rootPath;
 | 
|---|
| 4 | bool ActiveBasic::Common::Environment::isRemoveExternal = false;
 | 
|---|
| 5 | 
 | 
|---|
| 6 | using namespace ActiveBasic::Common;
 | 
|---|
| 7 | 
 | 
|---|
| 8 | void Environment::SetAbdevRootPath( const std::string &rootPath )
 | 
|---|
| 9 | {
 | 
|---|
| 10 |     Environment::rootPath = Jenga::Common::Path::MakeFullPath( rootPath, Jenga::Common::Environment::GetAppDir() );
 | 
|---|
| 11 | }
 | 
|---|
| 12 | const std::string Environment::GetAbdevRootPath()
 | 
|---|
| 13 | {
 | 
|---|
| 14 |     if( rootPath.empty() )
 | 
|---|
| 15 |     {
 | 
|---|
| 16 |         SetAbdevRootPath( "" );
 | 
|---|
| 17 |     }
 | 
|---|
| 18 |     return rootPath;
 | 
|---|
| 19 | }
 | 
|---|
| 20 | 
 | 
|---|
| 21 | const std::string Environment::GetUserAppDir()
 | 
|---|
| 22 | {
 | 
|---|
| 23 |     return Jenga::Common::Environment::GetUserAppDir() + "\\ActiveBasic";
 | 
|---|
| 24 | }
 | 
|---|
| 25 | 
 | 
|---|
| 26 | const std::string Environment::GetCompilerExePath( Platform::EnumType platform )
 | 
|---|
| 27 | {
 | 
|---|
| 28 |     switch( platform )
 | 
|---|
| 29 |     {
 | 
|---|
| 30 |     case Platform::X86:
 | 
|---|
| 31 |         return rootPath + "\\bin\\x86\\abc.exe";
 | 
|---|
| 32 |     case Platform::X64:
 | 
|---|
| 33 |         return rootPath + "\\bin\\x64\\abc.exe";
 | 
|---|
| 34 |     }
 | 
|---|
| 35 |     throw;
 | 
|---|
| 36 | }
 | 
|---|
| 37 | 
 | 
|---|
| 38 | void* operator new( std::size_t n )
 | 
|---|
| 39 | {
 | 
|---|
| 40 |     if ( void* p = dlmalloc(n) ){
 | 
|---|
| 41 |         return p;
 | 
|---|
| 42 |     }
 | 
|---|
| 43 |     else{
 | 
|---|
| 44 |         throw std::bad_alloc();
 | 
|---|
| 45 |     }
 | 
|---|
| 46 | }
 | 
|---|
| 47 | 
 | 
|---|
| 48 | void* operator new[]( std::size_t n )
 | 
|---|
| 49 | {
 | 
|---|
| 50 |     return ::operator new( n );
 | 
|---|
| 51 | }
 | 
|---|
| 52 | 
 | 
|---|
| 53 | void operator delete( void* p )
 | 
|---|
| 54 | {
 | 
|---|
| 55 |     dlfree( p );
 | 
|---|
| 56 | }
 | 
|---|
| 57 | 
 | 
|---|
| 58 | void operator delete[]( void* p )
 | 
|---|
| 59 | {
 | 
|---|
| 60 |     ::operator delete( p );
 | 
|---|
| 61 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.