toolsandutils/e32tools/elf2e32/source/usecasebase.cpp
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implementation of the Class UseCaseBase for the elf2e32 tool
       
    15 // @internalComponent
       
    16 // @released
       
    17 // 
       
    18 //
       
    19 
       
    20 #include <iostream>
       
    21 
       
    22 #include "usecasebase.h"
       
    23 #include "e32exporttable.h"
       
    24 
       
    25 #include "errorhandler.h"
       
    26 
       
    27 UseCaseBase::UseCaseBase(ParameterListInterface *aParameterListInterface)
       
    28 {
       
    29 	iParameterListInterface = aParameterListInterface;
       
    30 }
       
    31 
       
    32 
       
    33 UseCaseBase::~UseCaseBase()
       
    34 {
       
    35 }
       
    36 
       
    37 /**
       
    38 This function calls the DefInput() from ParameterManager through the interface.
       
    39 
       
    40 @internalComponent
       
    41 @released
       
    42 
       
    43 @return the name of the input DEF file if provided as input through --definput or 0.
       
    44 
       
    45 */
       
    46 char * UseCaseBase::DefInput()
       
    47 {
       
    48 	return (iParameterListInterface->DefInput());
       
    49 }
       
    50 
       
    51 /**
       
    52 This function calls the DSOOutput() from ParameterManager through the interface.
       
    53 
       
    54 @internalComponent
       
    55 @released
       
    56 
       
    57 @return the name of the outut DSO file if provided as input through --dso or 0.
       
    58 
       
    59 */
       
    60 char * UseCaseBase::DSOOutput()
       
    61 {
       
    62 	return (iParameterListInterface->DSOOutput());
       
    63 }
       
    64 
       
    65 /**
       
    66 This function calls the LinkAsDLLName() from ParameterManager through the interface.
       
    67 
       
    68 @internalComponent
       
    69 @released
       
    70 
       
    71 @return the name of the DLL to be linked with if provided as input through --linkas or 0.
       
    72 
       
    73 */
       
    74 char * UseCaseBase::LinkAsDLLName()
       
    75 {
       
    76 	return (iParameterListInterface->LinkAsDLLName());
       
    77 }
       
    78 
       
    79 /**
       
    80 This function calls the FileName() from ParameterManager through the interface.
       
    81 
       
    82 @internalComponent
       
    83 @released
       
    84 
       
    85 @param aFileName
       
    86 The filename alongwith the absolute path.
       
    87 
       
    88 @return the filename (without the absolute path) for valid input else 0.
       
    89 
       
    90 */
       
    91 char * UseCaseBase::FileName(char * aFileName)
       
    92 {
       
    93 	return (iParameterListInterface->FileName(aFileName));
       
    94 }
       
    95 
       
    96 /**
       
    97 This function calls the DefOutput() from ParameterManager through the interface.
       
    98 
       
    99 @internalComponent
       
   100 @released
       
   101 
       
   102 @return the name of the output DEF file if provided as input through --defoutput or 0.
       
   103 
       
   104 */
       
   105 char * UseCaseBase::DefOutput()
       
   106 {
       
   107 	return iParameterListInterface->DefOutput();
       
   108 }
       
   109 
       
   110 /**
       
   111 This function calls the ElfInput() from ParameterManager through the interface.
       
   112 
       
   113 @internalComponent
       
   114 @released
       
   115 
       
   116 @return the name of the Input ELF file if provided as input through --elfinput or 0.
       
   117 
       
   118 */
       
   119 char * UseCaseBase::InputElfFileName()
       
   120 {
       
   121 	return iParameterListInterface->ElfInput();
       
   122 }
       
   123 
       
   124 /**
       
   125 This function gets DSO file name from the parameter manager
       
   126 
       
   127 @internalComponent
       
   128 @released
       
   129 
       
   130 @return DSO file name
       
   131 
       
   132 */
       
   133 const char * UseCaseBase::OutputDSOFileName()
       
   134 {
       
   135 	return iParameterListInterface->DSOOutput();
       
   136 }
       
   137 
       
   138 /**
       
   139 This function gets the E32 image file name freom the parameter manager
       
   140 
       
   141 @internalComponent
       
   142 @released
       
   143 
       
   144 @return E32 image file name
       
   145 
       
   146 */
       
   147 const char * UseCaseBase::OutputE32FileName()
       
   148 {
       
   149 	return iParameterListInterface->E32ImageOutput();
       
   150 }
       
   151 
       
   152 /**
       
   153 This function returns if data in a DLL is allowed.
       
   154 
       
   155 @internalComponent
       
   156 @released
       
   157 
       
   158 @return if data in a DLL is allowed.
       
   159 
       
   160 */
       
   161 bool UseCaseBase::AllowDllData()
       
   162 {
       
   163 	return iParameterListInterface->DllDataP();
       
   164 }
       
   165 
       
   166 /**
       
   167 This function returns committed heap size
       
   168 
       
   169 @internalComponent
       
   170 @released
       
   171 
       
   172 @return committed heap size
       
   173 
       
   174 */
       
   175 size_t UseCaseBase::HeapCommittedSize()
       
   176 {
       
   177 	return iParameterListInterface->HeapCommittedSize();
       
   178 }
       
   179 
       
   180 /**
       
   181 This function returns reserved heap size
       
   182 
       
   183 @internalComponent
       
   184 @released
       
   185 
       
   186 @return reserved heap size
       
   187 
       
   188 */
       
   189 size_t UseCaseBase::HeapReservedSize()
       
   190 {
       
   191 	return iParameterListInterface->HeapReservedSize();
       
   192 }
       
   193 
       
   194 /**
       
   195 This function returns committed stack size
       
   196 
       
   197 @internalComponent
       
   198 @released
       
   199 
       
   200 @return committed stack size
       
   201 
       
   202 */
       
   203 size_t UseCaseBase::StackCommittedSize()
       
   204 {
       
   205 	return iParameterListInterface->StackCommittedSize();
       
   206 }
       
   207 
       
   208 /**
       
   209 This function returns if the def file is unfrozen
       
   210 
       
   211 @internalComponent
       
   212 @released
       
   213 
       
   214 @return if the def file is unfrozen
       
   215 
       
   216 */
       
   217 bool UseCaseBase::Unfrozen()
       
   218 {
       
   219 	return iParameterListInterface->Unfrozen();
       
   220 }
       
   221 
       
   222 /**
       
   223 This function returns Uid1
       
   224 
       
   225 @internalComponent
       
   226 @released
       
   227 
       
   228 @return Uid1
       
   229 
       
   230 */
       
   231 unsigned int UseCaseBase::GetUid1()
       
   232 {
       
   233 	return iParameterListInterface->Uid1();
       
   234 }
       
   235 
       
   236 /**
       
   237 This function returns Uid2
       
   238 
       
   239 @internalComponent
       
   240 @released
       
   241 
       
   242 @return Uid2
       
   243 
       
   244 */
       
   245 unsigned int UseCaseBase::GetUid2()
       
   246 {
       
   247 	return iParameterListInterface->Uid2();
       
   248 }
       
   249 
       
   250 /**
       
   251 This function returns Uid3
       
   252 
       
   253 @internalComponent
       
   254 @released
       
   255 
       
   256 @return Uid3
       
   257 
       
   258 */
       
   259 unsigned int UseCaseBase::GetUid3()
       
   260 {
       
   261 	return iParameterListInterface->Uid3();
       
   262 }
       
   263 
       
   264 /**
       
   265 This function returns secure Id
       
   266 
       
   267 @internalComponent
       
   268 @released
       
   269 
       
   270 @return secure Id
       
   271 
       
   272 */
       
   273 unsigned int UseCaseBase::GetSecureId()
       
   274 {
       
   275 	return iParameterListInterface->SecureId();
       
   276 }
       
   277 
       
   278 /**
       
   279 This function returns true if the --sid option is enabled.
       
   280 
       
   281 @internalComponent
       
   282 @released
       
   283 
       
   284 @return true if --sid option is passed in.
       
   285 
       
   286 */
       
   287 bool UseCaseBase::GetSecureIdOption()
       
   288 {
       
   289 	return iParameterListInterface->SecureIdOption();
       
   290 }
       
   291 
       
   292 /**
       
   293 This function returns vendor Id
       
   294 
       
   295 @internalComponent
       
   296 @released
       
   297 
       
   298 @return Vendor Id
       
   299 
       
   300 */
       
   301 unsigned int UseCaseBase::GetVendorId()
       
   302 {
       
   303 	return iParameterListInterface->VendorId();
       
   304 }
       
   305 
       
   306 /**
       
   307 This function returns version
       
   308 
       
   309 @internalComponent
       
   310 @released
       
   311 
       
   312 @return version
       
   313 
       
   314 */
       
   315 unsigned int UseCaseBase::GetVersion()
       
   316 {
       
   317 	return iParameterListInterface->Version();
       
   318 }
       
   319 
       
   320 /**
       
   321 This function returns call entry point
       
   322 
       
   323 @internalComponent
       
   324 @released
       
   325 
       
   326 @return call entry point
       
   327 
       
   328 */
       
   329 bool UseCaseBase::GetCallEntryPoints()
       
   330 {
       
   331 	return iParameterListInterface->CallEntryPoint();
       
   332 }
       
   333 
       
   334 /**
       
   335 This function returns capability
       
   336 
       
   337 @internalComponent
       
   338 @released
       
   339 
       
   340 @return capability
       
   341 
       
   342 */
       
   343 SCapabilitySet UseCaseBase::GetCapability()
       
   344 {
       
   345 	return iParameterListInterface->Capability();
       
   346 }
       
   347 
       
   348 /**
       
   349 This function returns priority
       
   350 
       
   351 @internalComponent
       
   352 @released
       
   353 
       
   354 @return priority
       
   355 
       
   356 */
       
   357 TProcessPriority UseCaseBase::GetPriority()
       
   358 {
       
   359 	return iParameterListInterface->Priority();
       
   360 }
       
   361 
       
   362 /**
       
   363 This function returns if fixed address is enabled.
       
   364 
       
   365 @internalComponent
       
   366 @released
       
   367 
       
   368 @return if fixed address is enabled.
       
   369 
       
   370 */
       
   371 bool UseCaseBase::GetFixedAddress()
       
   372 {
       
   373 	return iParameterListInterface->FixedAddress();
       
   374 }
       
   375 
       
   376 /**
       
   377 This function returns if compression is enabled.
       
   378 
       
   379 @internalComponent
       
   380 @released
       
   381 
       
   382 @return if compression is enabled.
       
   383 
       
   384 */
       
   385 bool UseCaseBase::GetCompress()
       
   386 {
       
   387 		return iParameterListInterface->Compress();
       
   388 }
       
   389 
       
   390 /**
       
   391 This function returns compression method
       
   392 
       
   393 @internalComponent
       
   394 @released
       
   395 
       
   396 @return UID of compression method
       
   397 
       
   398 */
       
   399 unsigned int UseCaseBase::GetCompressionMethod()
       
   400 {
       
   401 	return iParameterListInterface->CompressionMethod();
       
   402 }
       
   403 
       
   404 /**
       
   405 This function returns the FPU type.
       
   406 
       
   407 @internalComponent
       
   408 @released
       
   409 
       
   410 @return FPU type.
       
   411 
       
   412 */
       
   413 unsigned int UseCaseBase::GetFPU()
       
   414 {
       
   415 	return iParameterListInterface->FPU();
       
   416 }
       
   417 
       
   418 /**
       
   419 This function returns the library search path.
       
   420 
       
   421 @internalComponent
       
   422 @released
       
   423 
       
   424 @return libpath
       
   425 
       
   426 */
       
   427 ParameterListInterface::LibSearchPaths &  UseCaseBase::GetLibSearchPaths()
       
   428 {
       
   429 	return iParameterListInterface->LibPath();
       
   430 }
       
   431 
       
   432 /**
       
   433 This function returns the logfile name
       
   434 
       
   435 @internalComponent
       
   436 @released
       
   437 
       
   438 @return log file name
       
   439 
       
   440 */
       
   441 char * UseCaseBase::LogFile()
       
   442 {
       
   443 	return (iParameterListInterface->LogFile());
       
   444 }
       
   445 
       
   446 /**
       
   447 This function returns if the logging option is enabled
       
   448 
       
   449 @internalComponent
       
   450 @released
       
   451 
       
   452 @return logging option enabled.
       
   453 
       
   454 */
       
   455 bool UseCaseBase::LogFileOption()
       
   456 {
       
   457 	return (iParameterListInterface->LogFileOption());
       
   458 }
       
   459 
       
   460 /**
       
   461 This function returns if export library is enabled.
       
   462 
       
   463 @internalComponent
       
   464 @released
       
   465 
       
   466 @return if the export library is enabled.
       
   467 
       
   468 */
       
   469 bool UseCaseBase::GetIgnoreNonCallable()
       
   470 {
       
   471 	return iParameterListInterface->IgnoreNonCallable();
       
   472 }
       
   473 
       
   474 /**
       
   475 This function returns the directory separator
       
   476 
       
   477 @internalComponent
       
   478 @released
       
   479 
       
   480 @return directory separator
       
   481 
       
   482 */
       
   483 char UseCaseBase::GetDirectorySeparator()
       
   484 {
       
   485 	return iParameterListInterface->DirectorySeparator();
       
   486 }
       
   487 
       
   488 
       
   489 bool UseCaseBase::IsCodePaged()
       
   490 {
       
   491 	return (iParameterListInterface->IsCodePaged());
       
   492 }
       
   493 
       
   494 bool UseCaseBase::IsCodeUnpaged()
       
   495 {
       
   496 	return (iParameterListInterface->IsCodeUnpaged());
       
   497 }
       
   498 
       
   499 bool UseCaseBase::IsCodeDefaultPaged()
       
   500 {
       
   501 	return (iParameterListInterface->IsCodeDefaultPaged());
       
   502 }
       
   503 
       
   504 bool UseCaseBase::IsDataPaged()
       
   505 {
       
   506 	return (iParameterListInterface->IsDataPaged());
       
   507 }
       
   508 
       
   509 bool UseCaseBase::IsDataUnpaged()
       
   510 {
       
   511 	return (iParameterListInterface->IsDataUnpaged());
       
   512 }
       
   513 
       
   514 bool UseCaseBase::IsDataDefaultPaged()
       
   515 {
       
   516 	return (iParameterListInterface->IsDataDefaultPaged());
       
   517 }
       
   518 
       
   519 /**
       
   520 This function returns whether the debuggable option is enabled or not.
       
   521 
       
   522 @internalComponent
       
   523 @released
       
   524 
       
   525 @return whether debuggable option is enabled.
       
   526 
       
   527 */
       
   528 bool UseCaseBase::IsDebuggable()
       
   529 {
       
   530 	return (iParameterListInterface->IsDebuggable());
       
   531 }
       
   532 
       
   533 
       
   534 bool UseCaseBase::IsSmpSafe()
       
   535 {
       
   536 	return iParameterListInterface->IsSmpSafe();
       
   537 }
       
   538 
       
   539 /**
       
   540 This function returns if the unwanted exports are to be ignored
       
   541 
       
   542 @internalComponent
       
   543 @released
       
   544 
       
   545 @return if the unwanted exports are to be ignored
       
   546 
       
   547 */
       
   548 bool UseCaseBase::ExcludeUnwantedExports()
       
   549 {
       
   550 	return iParameterListInterface->ExcludeUnwantedExports();
       
   551 }
       
   552 
       
   553 /**
       
   554 This function returns if the target is a custom dll
       
   555 
       
   556 @internalComponent
       
   557 @released
       
   558 
       
   559 @return if target is a custom dll
       
   560 
       
   561 */
       
   562 bool UseCaseBase::IsCustomDllTarget()
       
   563 {
       
   564 	return iParameterListInterface->IsCustomDllTarget();
       
   565 }
       
   566 
       
   567 /**
       
   568 This function returns whether named lookup of symbols is enabled or not.
       
   569 
       
   570 @internalComponent
       
   571 @released
       
   572 
       
   573 @return default named symbol lookup enabled.
       
   574 
       
   575 */
       
   576 bool UseCaseBase::GetNamedSymLookup()
       
   577 {
       
   578 	return (iParameterListInterface->SymNamedLookup());
       
   579 }
       
   580